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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It 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
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.