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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
xhan
Helper I
Helper I

Service Principal accessing power BI Rest APIs

I followed https://docs.microsoft.com/en-us/power-bi/developer/embedded/embed-service-principal, to set up a service principal for using power bi rest APIs.

I am able to access admin APIs like scanResult, getInfo etc.

But when I tried to use it access `datasets` or `reports` apis, I got 

 

{'Message': 'API is not accessible for application'}

 

Could anyone suggest how could I enable the scopes for the reports and datasets apis?

 

Thank you!

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

Hi @xhan ,

 

According to your statement, I think the API is not accessible for your application.

 

For an Azure AD app to be able to access the Power BI content and APIs, a Power BI admin needs to enable the following setting:

  • Embed content in apps
  • Allow service principals to use Power BI APIs.

You need to apply this setting to your Security Group in which your Service Principal is a member.

For reference:

 Step 3 - Enable the Power BI service admin settings

 

Please make sure you have add your Service Principal as a member or admin into your Workspace which contains your datasets.

For reference:

 Step 4 - Add the service principal to your workspace

 

Best Regards,
Rico Zhou

 

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-rzhou-msft
Community Support
Community Support

Hi @xhan ,

 

According to your statement, I think the API is not accessible for your application.

 

For an Azure AD app to be able to access the Power BI content and APIs, a Power BI admin needs to enable the following setting:

  • Embed content in apps
  • Allow service principals to use Power BI APIs.

You need to apply this setting to your Security Group in which your Service Principal is a member.

For reference:

 Step 3 - Enable the Power BI service admin settings

 

Please make sure you have add your Service Principal as a member or admin into your Workspace which contains your datasets.

For reference:

 Step 4 - Add the service principal to your workspace

 

Best Regards,
Rico Zhou

 

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

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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