Forum Discussion
Access issues for Power BI Admin APIs
HI,
I am accessing Power BI Admin APIs to fetch user/semantic models and capacities details etc, However, when we run those APIs in our notebook, I get this error PowerBINotAuthorizedException . This requires some tenant settings in Power BI Service API permissions for our SPN, but it does not work. The settings look like this below:
Please let us know the exact setting to use Power BI APIs.
Thanks
Ati Puri
Hi ati_puri ,
Usually to access GET/ POST Power BI Admin APIs you would need two things.
1. Right Workspace / Tenant Permission
2. Properties if any needs to be enabled.
The Screenshot that you shared gives the list of permission.
If you had already enabled the tenant setting to access Power BI API, then enabling the tenant setting to use Power BI APIs alone might not allow you to access Admin APIs. You also need to enable the below Tenant Setting
Service principals can access read-only admin APIsIn general you can check if the below 3 tenant settings are enabledAdmin API Settings Service principals can access read-only admin APIs = Enabled Enhance admin APIs responses with detailed metadata = Enabled (optional but recommended) Enhance admin APIs responses with DAX and mashup expressions = Enabled (if scanning semantic models) You can try having these permission to your Service PrincipalTenant.Read.AllTenant.ReadWrite.All (If Read.All is not sufficient)One more thing to note is not all Admin APIs support Service Principal Authentication as far as I know. You can verify on that too for the Admin APIs you need.
Regards,
4 Replies
- ThejeswarSuper User
Hi ati_puri ,
Usually to access GET/ POST Power BI Admin APIs you would need two things.
1. Right Workspace / Tenant Permission
2. Properties if any needs to be enabled.
The Screenshot that you shared gives the list of permission.
If you had already enabled the tenant setting to access Power BI API, then enabling the tenant setting to use Power BI APIs alone might not allow you to access Admin APIs. You also need to enable the below Tenant Setting
Service principals can access read-only admin APIsIn general you can check if the below 3 tenant settings are enabledAdmin API Settings Service principals can access read-only admin APIs = Enabled Enhance admin APIs responses with detailed metadata = Enabled (optional but recommended) Enhance admin APIs responses with DAX and mashup expressions = Enabled (if scanning semantic models) You can try having these permission to your Service PrincipalTenant.Read.AllTenant.ReadWrite.All (If Read.All is not sufficient)One more thing to note is not all Admin APIs support Service Principal Authentication as far as I know. You can verify on that too for the Admin APIs you need.
Regards,
- GilbertQSuper User
Hi ati_puri
You can read the Microsoft Learning document below and go to details that you must not give certain permissions to the service principal. https://learn.microsoft.com/en-us/fabric/admin/enable-service-principal-admin-apis
- v-sathmakuriCommunity Support
- v-sathmakuriCommunity Support
Hi ati_puri ,
Could you please review the suggestion provided above and let us know if you still have any further questions?
Thanks!!