Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
NickA01
Resolver III
Resolver III

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
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

Check out the February 2024 Power BI update to learn about new features.

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Top Solution Authors
Top Kudoed Authors