cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
NickA01
Resolver II
Resolver II

admin api define myorg

Hi all. 

My org currently has has 2 seperate Power Bi tenants due to a merger. 
I have audit and platform scan set up on each tenant using ADF. 
Each tenant is as ring fenced setup. 
ADF in Azure Tenant A calls Power Bi API's in Tenant A and writes to an Azure SQl DB in Tenant A.
ADF is authorised by using system assigned managed identity in tenant A.
ADF in Azure Tenant B calls Power Bi API's in Tenant B and writes to an Azure SQl DB in Tenant B.
ADF is authorised by using system assigned managed identity in Tenant B.

Data is visualised in serveral reports in the Power BI service assiociated to Tenant B. 

Now, I want to just run 1 ADF, Have 1 SQl DB to store the data. 
The API's base url is https://api.powerbi.com/v1.0/myorg/admin/

The question is 
1: Can  'myorg' in the base url be replaced with the tenant ID. 
2: If it can, would I be correct that I'll need to set up a service principle in Tenant A, add it to my security group that can access the admin api  and call the API from Tenant B using the Service Principle credentials?

Thanks in advance.

1 ACCEPTED SOLUTION
v-yueyunzh-msft
Community Support
Community Support

Hi ,  @NickA01 

According to your description, you want to call the admin REST API in Power BI.

For your question, here is my understanding.As searched , the rest api in official document is like this:

GET https://api.powerbi.com/v1.0/myorg/admin/apps/{appId}/users

And the "myorg" is not contains the "{" and "}" , this means that this parameter cannot be replaced by tenantid.

In the interface document, only the parameters included in "{}" can be replaced by variables.

 

Secondly, whether you can successfully call the API depends on whether the API you generated the access token has permission to call the API.

My understanding is that it will automatically judge your tenant information based on the access token you obtained and return the corresponding value.
 

For detailed preconditions, you can check the description of each interface:

vyueyunzhmsft_0-1689558195313.png

And for this , you can also refer to :
Admin - REST API (Power BI Power BI REST APIs) | Microsoft Learn

 

Thank you for your time and sharing, and thank you for your support and understanding of PowerBI! 

 

Best Regards,

Aniya Zhang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

 

 

View solution in original post

1 REPLY 1
v-yueyunzh-msft
Community Support
Community Support

Hi ,  @NickA01 

According to your description, you want to call the admin REST API in Power BI.

For your question, here is my understanding.As searched , the rest api in official document is like this:

GET https://api.powerbi.com/v1.0/myorg/admin/apps/{appId}/users

And the "myorg" is not contains the "{" and "}" , this means that this parameter cannot be replaced by tenantid.

In the interface document, only the parameters included in "{}" can be replaced by variables.

 

Secondly, whether you can successfully call the API depends on whether the API you generated the access token has permission to call the API.

My understanding is that it will automatically judge your tenant information based on the access token you obtained and return the corresponding value.
 

For detailed preconditions, you can check the description of each interface:

vyueyunzhmsft_0-1689558195313.png

And for this , you can also refer to :
Admin - REST API (Power BI Power BI REST APIs) | Microsoft Learn

 

Thank you for your time and sharing, and thank you for your support and understanding of PowerBI! 

 

Best Regards,

Aniya Zhang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

 

 

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors