Forum Discussion
Getting error 403 Forbidden: while using Default.UpdateDatasources API
I’m trying to use the Default.UpdateDatasources API, but I’m encountering a 404 Forbidden error.
After investigating, I understand that to resolve this issue, I need to grant the following application-level API permissions:
- Dataset.ReadWrite.All
- Workspace.ReadWrite.All
However, when I attempt to add these permissions under API permissions in Azure AD, they are not available under "Application permissions", only under Delegated permissions.
Only Tenant.Read.All and Tenant.ReadWrite.All only these 2 permissions are available under Application type permissions.
Please advise on how to enable or add these application permissions for my registered app, so I can successfully call the API.
Hi Aniketparab1234,
Thank you for the response and confirming that the issue is resolved now. I request you to please accept the post as Accept as Solution so that other members who has similar issue will find it more quickly, don't forget to give a "Kudos" – I’d truly appreciate it!
Thanks and regards,
Anjan Kumar Chippa
8 Replies
- Akash_VarunaSuper User
Hi Aniketparab1234 From my understanding, the 403 error occurs because Dataset.ReadWrite.All and Workspace.ReadWrite.All are only available as Delegated, not Application permissions. To fix this, use delegated permissions with a signed-in user or enable service principal access in Power BI Admin portal. Also, ensure the service principal is allowed and has proper roles.
- grazitti_sapnaSuper User
Resolution Steps:
1. Ensure the Correct API is Added
Power BI API permissions added under "Application permissions" should be granted.
2. Grant Admin Consent
After adding the required application permissions:- Click "Grant admin consent for <Your Tenant>" to approve them for your tenant.
This is mandatory for application permissions to take effect. 3.Use a Service Principal (not a user)
Make sure you're using a service principal and Service principal should be enabled in Power BI Admin Portal.
🌟 I hope this solution helps you unlock your Power BI potential! If you found it helpful, click 'Mark as Solution' to guide others toward the answers they need.
💡 Love the effort? Drop the kudos! Your appreciation fuels community spirit and innovation.
🎖 As a proud SuperUser and Microsoft Partner, we’re here to empower your data journey and the Power BI Community at large.
🔗 Curious to explore more? [Discover here].
Let’s keep building smarter solutions together!- Aniketparab1234Regular Visitor
Thank you for your feedback.
Actually,The tenant setting “Service principals can use Fabric APIs” has already been enabled from the PowerBI Admin portal.
And when I go to add permission under Application Type, it only shows Tenant permissions, not Report or Workspace permissions which are required to use update dataset API.
- Swetha__BalusamNew Member
Hi, I am also facing the same issue. Have you found any solution?
- v-achippaCommunity Support
Hi Aniketparab1234,
Thank you for reaching out to Microsoft Fabric Community.
The issue here is that only Tenant.Read.All permissions are visible under Application permissions and not the full set like Dataset.ReadWrite.All or Workspace.ReadWrite.All. Please follow below steps:
- Ensure the application is registered in your home tenant, not as a guest user. App registrations made as guest may not expose the full set of API permissions.
- Re add the Power BI API by searching for power bi service.
- If the permissions still do not appear, ask your Azure Admin to manually assign Dataset.ReadWrite.All and Workspace.ReadWrite.All permissions to the app.
- After permissions are added make sure to grant admin consent for the tenant.
Once this is done the service principal will have the correct access to call Default.UpdateDatasources.
If this post helps, then please consider Accepting as solution to help the other members find it more quickly, don't forget to give a "Kudos" – I’d truly appreciate it!
Thanks and regards,
Anjan Kumar Chippa
- Aniketparab1234Regular Visitor
Thanks v-achippa ,
You're right, those permissions might show up after these changes.
I was actually experimenting with some modifications to the body I was passing when calling the Update Dataset API. After adding a few additional inputs, the API call worked successfully and updated the datasource for that specific report.
Thank you for your suggestions!
- v-achippaCommunity Support
Hi Aniketparab1234,
Thank you for the response and confirming that the issue is resolved now. I request you to please accept the post as Accept as Solution so that other members who has similar issue will find it more quickly, don't forget to give a "Kudos" – I’d truly appreciate it!
Thanks and regards,
Anjan Kumar Chippa