Forum Discussion

BindiyaThota's avatar
BindiyaThota
Helper I
8 months ago
Solved

Gateway cluster API call error

Hi, I am trying to call below API through service principal and it is running into 401 error. "https"//api.powerbi.com/v2.0/myorg/gatewayClusters?$expand=memberGateways"   Service principal is ad...
  • v-echaithra's avatar
    8 months ago

    Hi BindiyaThota ,

    A 401 Unauthorized error when calling the Power BI Gateway Cluster Admin API through a service principal usually indicates a configuration issue in either Azure AD or the Power BI Admin Portal. Remove any admin-consent-required AAD app permissions from the app registration and then request a new token. Ensure service principal access is enabled in Power BI tenant settings.

    In Power BI Admin Portal > Tenant Settings > Developer Settings:

    Allow service principals to use Power BI APIs

    Allow service principals to access admin APIs

    If these settings are restricted to specific security groups, make sure your service principal is included.

    Try to add the service principal itself as a Gateway Cluster Admin in Power BI > Manage Gateways.

    Hope this helps.
    Thank you.