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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
Anonymous
Not applicable

Power BI REST API gives 403 forbidden (use service principal)

Hi everyone,

 

I want to get the powerbi dataset refresh history programmatically so I need to call the Power BI API using the below method,

 

 

 

GET https://api.powerbi.com/v1.0/myorg/groups/{groupId}/datasets/{datasetId}/refreshes

 

 

 

I follow the MS docs and this guide and created an app on Azure, and currently I can get the access token successfully but when I run the HTTP request it return 403 forbidden error,

 

The below is what I have tried but still the same error:

 

  • I grant almost all the PBI permission to this app (both delegate and application) as figure below,

微信图片_20220203192955.png

  • I already added the app (service principal) as admin in my Power BI Workspace,

 

(I also enable Allow service principals to use Power BI APIs in PBI Admin portal)

 

  • I have tried to call the REST API on Power BI Desktop query editor and Postman, always return forbidden error. Below screenshot is where I tried on Power BI Desktop, I also can get the access token but still 403 when I try to use the token to call API.

微信图片_20220203195553.png

微信图片_20220203200013.png

So how do I fix this? anything missing? It cost me so much time but still cannot use the API successful.

Any solution would be much appreciated!

1 ACCEPTED SOLUTION
4 REPLIES 4
lbendlin
Super User
Super User

"added the app (service principal) as admin in my Power BI Workspace,"

 

But you are using an API call against Premium workspaces.  Does your service principal have access to the Premium workspaces you are trying to access?

Anonymous
Not applicable

Hi @lbendlin , I granted my service principal as admin role in this premium workspace (as figure 3) so I believe it can access the content. 

Really frustrating that the "solution" is just a pointer to a totally different type of authentication and thereby does not resolve the posted problem at all. 

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.