Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
ledd_25
Frequent Visitor

PowerBI Audit Activity events API - Scheduled RefreshDataset activity

im trying to get refresh activity for all datasets in the organization using service principal utilizing the get activity events

However this does not include scheduled events. You can use get refresh history, but it only works for workspaces you have access to.

But im trying to get all the scheduled refresh events of all datasets in the organization. Are there other ways to access that without being part of every workspace?

if no, then  how could you get all scheduled refresh dataset activities of the org's datasets? Do you need to programmatically set yourself as a workspace user temporarily then remove when done?

1 ACCEPTED SOLUTION

Yes. Use GetGroupsAsAdmin to get the workspace then run AddUserAsAdmin for each. Pick you favourite scripting language of choice


Did I answer your question?
Please help by clicking the thumbs up button and mark my post as a solution!

View solution in original post

8 REPLIES 8
Poojara_D12
Super User
Super User

Hi @ledd_25 

You're correct in identifying a key limitation in the Power BI REST APIs: while Get Activity Events provides audit-level activity logs, it does not capture scheduled refreshes that were successful, as these are not considered user-triggered actions. On the other hand, the Get Refresh History API does provide detailed refresh logs (including scheduled ones), but only for datasets in workspaces where the calling identity—like your service principal—has at least viewer access. Unfortunately, there is no out-of-the-box method to fetch refresh histories across all datasets in the entire tenant using a service principal unless that principal has explicit access to every workspace.

 

To overcome this, the most viable method is to programmatically assign your service principal (or an automation account) to each workspace with viewer or contributor access, run the Get Refresh History for all datasets, and then optionally remove the access afterward. This can be automated using the Power BI Admin APIs (Add Group User, List Groups, Get Datasets In Group, etc.), but it requires your service principal to have Power BI Admin API permissions and the Tenant.Read.All or Workspace.Read.All Graph permissions.

 

Alternatively, if you're a Power BI Service Administrator, you can consider setting up a custom logging solution using Power BI's audit logs via Microsoft Purview (formerly Compliance Center), which can log dataset refresh activity (including scheduled ones), though it comes with delays and more complex parsing.

 

In short, yes—temporarily granting your service principal access to all workspaces programmatically, then removing it post-extraction, is currently the most effective and scalable way to gather all scheduled refresh activity from across the organization.

 

Did I answer your question? Mark my post as a solution, this will help others!
If my response(s) assisted you in any way, don't forget to drop me a "Kudos"

Kind Regards,
Poojara - Proud to be a Super User
Data Analyst | MSBI Developer | Power BI Consultant
Consider Subscribing my YouTube for Beginners/Advance Concepts: https://youtube.com/@biconcepts?si=04iw9SYI2HN80HKS
v-dineshya
Community Support
Community Support

Hi @ledd_25 ,

Thank you for reaching out to the Microsoft Community Forum.

 

The Get Activity Events API from Power BI’s Admin REST API returns audit log events for a tenant, but it does not include scheduled refresh events. This is a known limitation.


please refer below for alternative workaround.

 

1. Use the Get Refresh History API, but it requires access to each workspace. Power BI Service Admin can use the Admin APIs to enumerate all datasets across the tenant using GetDatasetsAsAdmin, then loop through each dataset to call Get Refresh History.

 

Note: This still requires that the service principal has access to each workspace.


2. Audit logs for Power BI can be captured through the Microsoft 365 Audit Log . This includes scheduled refreshes if audit logging is enabled in the Power BI Admin Portal.


3. When the service principal is not a member, If you want access refresh history for workspaces try the below workaround.

 

Temporarily assign the service principal to each workspace. Fetch the refresh history and then remove the service principal, this can be automated using the Power BI REST Admin APIs.

 

Please refer below microsoft official document for your reference.

Admin - Get Activity Events - REST API (Power BI Power BI REST APIs) | Microsoft Learn

 

If my response has resolved your query, please mark it as the "Accepted Solution" to assist others. Additionally, a "Kudos" would be appreciated if you found my response helpful.

Thank you

Hi @ledd_25 ,

We haven’t heard from you on the last response and was just checking back to see if you have a resolution yet.do click Accept Answer and Yes for was this answer helpful. And, if you have any further query do let us know.

 

Thank you.

Hi @ledd_25 ,

We haven’t heard from you on the last response and was just checking back to see if you have a resolution yet. And, if you have any further query do let us know.

 

Thank you.

Hi @ledd_25 ,

We haven’t heard from you on the last response and was just checking back to see if you have a resolution yet. And, if you have any further query do let us know.

 

Thank you.

Deku
Super User
Super User

You would need read access to the semantic models.

 

Alternatively you can set log analytics integration on each workspace. This will give all refreshes, plus you get the benefit of knowing how long the refreshes take and the cpu cost, plus you get stats for individual tables and partitions etc 


Did I answer your question?
Please help by clicking the thumbs up button and mark my post as a solution!
ledd_25
Frequent Visitor

I have over 1000 workspaces, is there any way to programmatically do that? if no, what other alternatives do i have?

Yes. Use GetGroupsAsAdmin to get the workspace then run AddUserAsAdmin for each. Pick you favourite scripting language of choice


Did I answer your question?
Please help by clicking the thumbs up button and mark my post as a solution!

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.