Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hello all,
I looking for a solution to get evant activity ou audit log from power bi rest api or azure.
I created a application on azure, a service principal and a secret.
A have thoses permissions too :
Microsoft Graph
- user.read.all (delegated and appli)
- auditlog.read.all (delegated and appli)
- directory.read.all (delegated and appli)
- report.read.all (delegated and appli)
Power BI Service
Tenand.read.all
A still have error messages when a tried to get data about activityevent from power bi resta pi or auditlog from azure.
Important information, i do not have a administrator role.
If someone have some informations about that thank to all
Hi @Toi69___ ,
Thanks for reaching out to the Microsoft fabric community forum.
@rohit1991 , @Poojara_D12 , @lbendlin
Thanks for your prompt response
I wanted to follow up and confirm whether you’ve had the opportunity to review the information provided super users . Should you have any questions or require further clarification, please don't hesitate to reach out.
We appreciate your engagement and thank you for being an active part of the community.
Best Regards,
Lakshmi Narayana
Hi @Toi69___ ,
You're encountering errors when trying to access Power BI activity events or Azure audit logs via the REST API because, even though your Azure application has the correct API permissions (such as AuditLog.Read.All, Directory.Read.All, and Tenant.Read.All), accessing this type of sensitive organizational data requires elevated privileges. Specifically, Microsoft enforces that only users with either the Power BI Service Administrator role or Microsoft 365 Global Administrator role can retrieve audit logs and activity event data.
This applies whether you're using delegated permissions (on behalf of a signed-in user) or application permissions via a service principal. Without one of these admin roles, the APIs will block access, regardless of the app's permission grants.
To move forward, you would either need an administrator to grant consent on behalf of the organization and assign the appropriate admin role to your service account, or request that an admin run the query and provide the data you need. Unfortunately, there's no workaround to bypass this requirement, as it's a security restriction built into Microsoft’s auditing and compliance controls.
Hi @Toi69___
You're attempting to access Power BI activity events or audit logs using the Power BI REST API or Microsoft Graph API by leveraging an Azure AD app registration with a service principal and secret. You've correctly assigned both delegated and application-level permissions such as AuditLog.Read.All, Directory.Read.All, Report.Read.All, and Tenant.Read.All, which are required to query audit and activity data. However, despite this setup, you're encountering errors when trying to retrieve the activity data, and the key limitation here is that you do not hold an administrator role in your tenant.
This is important because accessing audit logs—whether through the Power BI REST API (GetActivityEvents) or Microsoft Graph API (/auditLogs)—requires elevated privileges that only users in certain administrative roles can exercise. Specifically, you need to be assigned a role such as Global Administrator, Compliance Administrator, Security Administrator, or Report Reader with audit log access. Without this, even though your app technically has the required API permissions, the underlying user context or service principal identity is not authorized to access tenant-level audit data.
In summary, the error you’re facing is due to insufficient directory-level permissions tied to your role, not just the API permissions in Azure. To resolve this, you’ll need to request that a tenant administrator either:
Assign you an appropriate admin role (like Compliance Admin), or
Set up a separate service principal account with the required role and permissions, and use that identity for your API calls.
Without admin role privileges, Microsoft blocks access to sensitive logs for security and compliance reasons, regardless of the app permissions granted in Azure AD.
Thank you for this overview.
I still have a question when you say :
"Set up a separate service principal account with the required role and permissions, and use that identity for your API calls."
I do not understand beacause when a make ma api call, i use my service principal informations to get data.
Here this is my python witch give me the token :
Important information, i do not have a administrator role.
Then you will not have access to these API endpoints.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
9 | |
7 | |
2 | |
2 | |
2 |
User | Count |
---|---|
6 | |
5 | |
4 | |
4 | |
4 |