Forum Discussion

ati_puri's avatar
ati_puri
Resolver III
30 days ago
Solved

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 . ...
  • Thejeswar's avatar
    30 days ago

    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 APIs
     
    In general you can check if the below 3 tenant settings are enabled
    Admin 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 Principal
    Tenant.Read.All 
    Tenant.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,