Get certified for free when you join Fabric Data Days 2026 and dive into Fabric, Power BI, SQL, AI, and other essential data skills.
Join nowTry your skills in the Power BI Dataviz World Championship! Round one ends June 26. Join now
I am encountering an issue accessing the endpoints for reports and datasets in the Power BI API.
I generate the access token with:
“auth_url” : https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0/token
grant_type": client_credentials,
"client_id": CLIENT_ID,
"client_secret": CLIENT_SECRET,
"scope": "https://analysis.windows.net/powerbi/api/.default"
Test in postman.
I had enabled Service Principal Access in Power BI and granted all the necessary permissions:
It seems that the datasets and reports permission should be added with API permission type, but the application permissions only show ‘Tenant.Read.All’ and ‘Tenant.ReadWrite.All’ ? Anything I miss?
Solved! Go to Solution.
Hi @Xiaolingwh ,
Thank you for reaching out to Microsoft Community.
Since the GET datasets API is working, the authentication setup appears to be correct. The 401 Unauthorized "PowerBINotAuthorizedException" during ExecuteQueries is usually related to dataset permissions or tenant settings.
Please verify the following:
Ensure both tenant settings are enabled in Power BI Admin Portal:
Service principals can use Fabric APIs
Dataset Execute Queries REST API
Explicitly grant the Service Principal:
Build permission, read permission on the dataset under Manage Permissions.
Verify the semantic model is not using unsupported scenarios such as RLS, SSO, or certain Live Connections.
Confirm the access token audience (aud) is: https://analysis.windows.net/powerbi/api
If tenant settings are restricted to a security group, ensure the Service Principal is added to that group and allow time for propagation.
Also, it is expected that Dataset/Report permissions are available only as Delegated permissions in Azure AD. Most Power BI REST APIs with Service Principals rely on workspace and tenant-level authorization rather than Application API permissions.
Hope this helps.
Hi @Xiaolingwh ,
We wanted to kindly follow up regarding your query. If you need any further assistance, please reach out.
Thank you.
Hi @Xiaolingwh ,
We’d like to follow up regarding the recent concern. Kindly confirm whether the issue has been resolved, or if further assistance is still required. We are available to support you and are committed to helping you reach a resolution.
Thank you.
Hi @Xiaolingwh ,
Thank you for reaching out to Microsoft Community.
Since the GET datasets API is working, the authentication setup appears to be correct. The 401 Unauthorized "PowerBINotAuthorizedException" during ExecuteQueries is usually related to dataset permissions or tenant settings.
Please verify the following:
Ensure both tenant settings are enabled in Power BI Admin Portal:
Service principals can use Fabric APIs
Dataset Execute Queries REST API
Explicitly grant the Service Principal:
Build permission, read permission on the dataset under Manage Permissions.
Verify the semantic model is not using unsupported scenarios such as RLS, SSO, or certain Live Connections.
Confirm the access token audience (aud) is: https://analysis.windows.net/powerbi/api
If tenant settings are restricted to a security group, ensure the Service Principal is added to that group and allow time for propagation.
Also, it is expected that Dataset/Report permissions are available only as Delegated permissions in Azure AD. Most Power BI REST APIs with Service Principals rely on workspace and tenant-level authorization rather than Application API permissions.
Hope this helps.
| User | Count |
|---|---|
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 |