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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Extracting PowerBI audit logs using Python

Hi folks

Did any of you successfully automated extraction of PowerBI audit logs for custom reporting using Azure Active Directory by registering an APP for making API calls.

 

Any info is greatly appreciated.

 

3 REPLIES 3
asifrasool
Helper I
Helper I

Hi @Anonymous have you figured out how you answer these questions? if so, please let me know

selimovd
Super User
Super User

Hey @Anonymous ,

 

I'm not sure if that is what you're looking for, but the Audit logs can be exported with a PowerShell script:

Track user activities in Power BI - Power BI | Microsoft Docs

 

This you could possibly embed in Python, but I think the probably better approach would be to add that PowerShell script to the serverless environment of Azure Functions:

Create a PowerShell function using Visual Studio Code - Azure Functions | Microsoft Docs

 

If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
 
Best regards
Denis
 
Anonymous
Not applicable

HI @selimovd 

I have been told by MS tech support that not all PowerBI Audit data points are available in PowerShell approach. I am not sure how accurate is this statement?

My initial goal is to extract below data for custom reporting with more than  6 months data.

 Who is accessing
◦What are the most used reports
◦Who has access
◦Extract times
◦Longest refresh runs

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.