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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
MalaSun
Frequent Visitor

403 Forbidden on Power BI REST API “Refresh Dataset” – Service Principal Permissions with Power BI P

Hi Fabric Community,

I am building a Python web application that lets users upload their own cash flow data (CSV), which then triggers a refresh of a Power BI dataset via the Power BI REST API. My use case is for a “Power BI Embedded” scenario, but at this stage I am just testing with my own workspace and dataset.

My setup:

  • Azure AD App Registration (service principal) with the following permissions:

    • Power BI Service: Dataset.ReadWrite.All (Delegated, Admin Consent granted)

    • Also tried Tenant.ReadWrite.All but removed for security reasons.

  • Power BI workspace is a “classic” workspace, but I am workspace admin and have assigned the service principal as Contributor.

  • Redirect URI is set up and matches my Ngrok public URL, and authentication works (I get an access token and can list workspaces/datasets).

  • When I POST to /groups/{workspaceId}/datasets/{datasetId}/refreshes, I get a 403 Forbidden error.

Questions:

  1. Does a Power BI Pro (free trial) license for the workspace admin (me) allow the use of Service Principal authentication to refresh datasets via REST API, or is Premium/PPU required?

  2. Is Dataset.ReadWrite.All (Delegated) permission sufficient for the service principal to call the refresh API, or do I need to assign an Application permission? (This permission does not seem to be available for my app.)

  3. Is there anything else I should check in Azure or the Power BI admin settings to allow this operation?

  4. Could my license type (Power BI Pro Trial) or the fact that the workspace is not in a Premium capacity be the reason for the 403 error?

Debug details:

  • I receive a valid access token (“Access token acquired.”)

  • The API call to refresh the dataset returns 403, with no further error text.

Screenshots attached (showing permissions, error, workspace access, and API config).

Any help would be greatly appreciated! Thank you.

 

Tags: powerbi-rest-api, service-principal, permissions, dataset-refresh, pro-license, premium, embedded

1 ACCEPTED SOLUTION
v-agajavelly
Community Support
Community Support

Hi @MalaSun 

Thanks a lot for the detailed explanation it's clear. To directly address your main issue.

Even though your service principal has the right permission (Dataset.ReadWrite.All) and you’ve added it as a Contributor to the workspace the reason you're hitting a 403 error is because. Dataset refresh via service principal is only supported in Premium or PPU (Premium Per User) workspaces. This means that with your current Pro trial license and non-Premium workspace, the Power BI REST API won't allow a service principal to trigger a dataset refresh. That’s a limitation by design from Microsoft, not something misconfigured on your end.

We have two clean options

  1. Upgrade the workspace to Premium or PPU:
    • If you're using Fabric Trial, try assigning the workspace to a Premium capacity (like trial F64 or any A SKU).
    • Or enable PPU (Premium Per User) on your account and workspace.

 Once that’s done, your existing service principal setup should start working perfectly.

  1. Temporary workaround Use a Power BI user account (aka "master user") with a Pro license to trigger the refresh instead of a service principal.
    • This works in Pro workspaces but isn’t ideal long-term, especially from a security/automation point of view.

Hope this clears up the mystery behind the 403.

If this response helps, consider marking it as “Accept as solution” and giving a “kudos” to assist other community members.

Regards,
Akhil.

View solution in original post

4 REPLIES 4
v-agajavelly
Community Support
Community Support

Hi @MalaSun 

Thanks a lot for the detailed explanation it's clear. To directly address your main issue.

Even though your service principal has the right permission (Dataset.ReadWrite.All) and you’ve added it as a Contributor to the workspace the reason you're hitting a 403 error is because. Dataset refresh via service principal is only supported in Premium or PPU (Premium Per User) workspaces. This means that with your current Pro trial license and non-Premium workspace, the Power BI REST API won't allow a service principal to trigger a dataset refresh. That’s a limitation by design from Microsoft, not something misconfigured on your end.

We have two clean options

  1. Upgrade the workspace to Premium or PPU:
    • If you're using Fabric Trial, try assigning the workspace to a Premium capacity (like trial F64 or any A SKU).
    • Or enable PPU (Premium Per User) on your account and workspace.

 Once that’s done, your existing service principal setup should start working perfectly.

  1. Temporary workaround Use a Power BI user account (aka "master user") with a Pro license to trigger the refresh instead of a service principal.
    • This works in Pro workspaces but isn’t ideal long-term, especially from a security/automation point of view.

Hope this clears up the mystery behind the 403.

If this response helps, consider marking it as “Accept as solution” and giving a “kudos” to assist other community members.

Regards,
Akhil.

MalaSun
Frequent Visitor

Thank you for the insight. I’m currently building a proof of concept for internal use, with strictly controlled upload volume. Eventually I’ll implement rate limiting or background queues for refresh to prevent overload.

Right now, my issue is that even a single refresh call returns a 403 Forbidden despite valid permissions. Do you know if this API refresh is supported for service principals in Pro workspaces? Or is Premium/PPU strictly required?

lbendlin
Super User
Super User

I am building a Python web application that lets users upload their own cash flow data (CSV), which then triggers a refresh of a Power BI dataset via the Power BI REST API.

VBI  (very bad idea).  Your users with thrash the Power BI service with concurrent refresh requests. Best case you will get a 429 back, worst case you'll choke the capacity. Do not allow your report users to initiate semantic model refreshes.

Hi Ibendin, 

Thank you for your comments. What alternative solutions could you recommend for what I wanted to achieve? 

Helpful resources

Announcements
Fabric July 2025 Monthly Update Carousel

Fabric Monthly Update - July 2025

Check out the July 2025 Fabric update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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