Forum Discussion
Power BI REST API - retrieving activity events returns 403 / "API is not accessible for application"
Hi micpol ,
You must meet these requirements to access the Power BI activity log:
- You must either be a global admin or a Power BI service admin.
- You have installed the Power BI Management cmdlets locally or use the Power BI Management cmdlets in Azure Cloud Shell.
Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi V-lianl-msft ,
thank you for your reply.
My case is related to embedding content for customers (https://docs.microsoft.com/en-us/power-bi/developer/embedded/embed-sample-for-customers?tabs=net-framework , https://docs.microsoft.com/en-us/power-bi/developer/embedded/embed-service-principal ), so I am using a Power BI servcice principal (App account), not an AAD user account.
The service principal has been added to Power BI service admin list as well as required scopes have been set correctly.
Furthermore, I am talking to the Power BI service by means of the REST API (https://docs.microsoft.com/en-us/rest/api/power-bi/admin/getactivityevents) from within my application (backend), I am not using any Power BI Management cmdlets.
According to https://docs.microsoft.com/en-us/rest/api/power-bi/admin/getactivityevents it is possible to get authenticated via service principal. Note that other Power BI REST APIs are working fine.
In this particular case the message I am facing is "API is not accessible for application" and the HTTP error code is 403 Forbidden. It seems to me that the https://docs.microsoft.com/en-us/rest/api/power-bi/admin/getactivityevents does not work with a service principal.
Summarizing, is that feasible to get acticity events using a service principal created for the "embed content for your customers" case at all? I would like to have acccess to that activity log from within an application (backend).
Best reagrds,
Michal
- Anonymous2 years agoNot applicable
Did you get that resolved? It is 2024 and it is still not easy to set it up.
Microsoft should really clarify their documentation.