Forum Discussion
Get Activity Events API - PowerBINotAuthorizedException Error
- Anonymous3 months ago
Hi JamieHut ,
Based on your description, it appears that the Entra ID application has been assigned the Power BI Tenant.Read.All application permission. For the Get Activity Events admin API, Microsoft requires that service principal authentication be enabled via the Power BI tenant settings, and that the service principal is included in the designated security group. However, the app registration should not have Power BI admin consent-required permissions like Tenant.Read.All or Tenant.ReadWrite.All. Instead, authorization is managed through the Power BI Admin Portal settings rather than through app registration permissions.
Please check if the access token you are generating is a service principal token by decoding the JWT and reviewing the claims. If so, remove Power BI application permissions from the app registration, allow time for the changes to take effect, generate a new token, and retest the API. Additionally, confirm that the service principal is part of the exact security group specified in the Power BI Admin Portal tenant settings. Workspace Admin permissions are not relevant for this endpoint, as Get Activity Events is a tenant-level Admin API.
If you are using delegated user authentication instead of a service principal, ensure the account has the Fabric Administrator or Power BI Service Administrator role as workspace permissions alone are insufficient for this API.
For further information, please review the Microsoft documentation below
Get Activity Events API - PowerBINotAuthorizedExce... - Microsoft Fabric Community
Admin - Get Activity Events - REST API (Power BI Power BI REST APIs) | Microsoft Learn
Automate Power BI Premium workspace and semantic model tasks with service principals - Microsoft Fabric | Microsoft Learn
OAuth 2.0 client credentials flow on the Microsoft identity platform - Microsoft identity platform | Microsoft Learn
Admin API admin settings - Microsoft Fabric | Microsoft Learn
Thank you.
Hi JamieHut ,
Based on your description, it appears that the Entra ID application has been assigned the Power BI Tenant.Read.All application permission. For the Get Activity Events admin API, Microsoft requires that service principal authentication be enabled via the Power BI tenant settings, and that the service principal is included in the designated security group. However, the app registration should not have Power BI admin consent-required permissions like Tenant.Read.All or Tenant.ReadWrite.All. Instead, authorization is managed through the Power BI Admin Portal settings rather than through app registration permissions.
Please check if the access token you are generating is a service principal token by decoding the JWT and reviewing the claims. If so, remove Power BI application permissions from the app registration, allow time for the changes to take effect, generate a new token, and retest the API. Additionally, confirm that the service principal is part of the exact security group specified in the Power BI Admin Portal tenant settings. Workspace Admin permissions are not relevant for this endpoint, as Get Activity Events is a tenant-level Admin API.
If you are using delegated user authentication instead of a service principal, ensure the account has the Fabric Administrator or Power BI Service Administrator role as workspace permissions alone are insufficient for this API.
For further information, please review the Microsoft documentation below
Get Activity Events API - PowerBINotAuthorizedExce... - Microsoft Fabric Community
Admin - Get Activity Events - REST API (Power BI Power BI REST APIs) | Microsoft Learn
Automate Power BI Premium workspace and semantic model tasks with service principals - Microsoft Fabric | Microsoft Learn
OAuth 2.0 client credentials flow on the Microsoft identity platform - Microsoft identity platform | Microsoft Learn
Admin API admin settings - Microsoft Fabric | Microsoft Learn
Thank you.
- JamieHut3 months agoNew Member
Such as simple solution, but exactly what I needed. I removed the Tenant.Read.All permission and it works perfectly! Thank you 🙂