User Profile
Sreenatha
New Member
Joined 5 years ago
User Widgets
Contributions
PowerBINotAuthorizedException exception when executing admin/activityevents API
I am trying to collect powerbi usage via the admin/activityevents API but I get PowerBINotAuthorizedException in the response. Steps followed to generate the token: Created an azure AD app and assigned Tenant.Read.All and Tenant.ReadWrite.All permissions to it and granted the permissions. Generated the token using oauth2/v2.0/token api where I used grant_type as client_credentials and scope as https://analysis.windows.net/powerbi/api/.default. I got PowerBINotAuthorizedException exception. Further I tried to use Service Principal to hit the API using below steps: 1) Added new security group and added the App as member of it. 2) In PowerBi Tenant settings, allowed ServicePrincipal to hit PowerBI and also ReadOnly admin APIs. Generated the token and hit the activityevent api but still got same PowerBINotAuthorizedException. Though I was able to hit the API with grant_type password, but we do not want to use that approach. What am I missing? Is it possible to use app authentication/service principal authentication to hit admin APIs specifically activityevents api? My main usecase is to get the last activity date of every powerbi user.15KViews0likes5Comments
Data Privacy
Microsoft Fabric Community and Privacy
To learn more about how we manage your data, please review the Microsoft Fabric Community Data Privacy guide.