Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
Hello,
I'm trying to get the API Rest Get Activity Events information on my tenant
I've made a small test on https://learn.microsoft.com/en-us/rest/api/power-bi/admin/get-activity-events using my account (am Azure admin and Power BI admin) but it seems there is a problem:
One of my coworkers tried this test on his client (where's he's not admin) and he gets en error 401 "Unauthorized", but I'm getting an error 400 “Bad Request”, why?
The Develeper settings in the Power BI tenant admin portal are correctly set:
As the Microsoft Azure App registration:
I also tryed to call the API using Postman with a generated Token, but it keeps saying PowerBINotAuthorizedException
Generating the Token:
Calling the activityevents:
Have I missed something?
Solved! Go to Solution.
Thanks for the reply from lbendlin , please allow me to provide another insight:
Hi @Anonymous ,
Based on the official documentation mentioned, "
When running under service prinicipal authentication, an app must not have any admin-consent required premissions for Power BI set on it in the Azure portal.", it means that all the Power BI permissions granted for this must be un-consent and removed for a new service principal AAD token to grant for the rest API running, as long as you have enabled this tenant admin setting
Admin - Get Activity Events - REST API (Power BI Power BI REST APIs) | Microsoft Learn
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
With same App registration config (delegated), I had the same activityEventEntities response 400 issue recently, it has been fixed by updating the date formatting. Try matching the date format of "CreationTime" to "2025-03-03T00:00:14".
Thanks for the reply from lbendlin , please allow me to provide another insight:
Hi @Anonymous ,
Based on the official documentation mentioned, "
When running under service prinicipal authentication, an app must not have any admin-consent required premissions for Power BI set on it in the Azure portal.", it means that all the Power BI permissions granted for this must be un-consent and removed for a new service principal AAD token to grant for the rest API running, as long as you have enabled this tenant admin setting
Admin - Get Activity Events - REST API (Power BI Power BI REST APIs) | Microsoft Learn
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Permissions
The user must have administrator rights (such as Office 365 Global Administrator or Power BI Service Administrator) or authenticate using a service principal.
Delegated permissions are supported.
When running under service prinicipal authentication, an app must not have any admin-consent required premissions for Power BI set on it in the Azure portal.
Are you speaking about this, I can't turn it off?
I also tried those 2 options in Azure Portal but it ain't changing anything:
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
11 | |
3 | |
3 | |
2 | |
2 |