Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Admin API - Get Activity Events (GET https://api.powerbi.com/v1.0/myorg/admin/activityevents) doesn't return data when activity data exists in the audit log.
When using "Admin - Get Activity Events" API it doesn't return data for dates in past 90 days
When using "Get-PowerBIActivityEvents" in Powershell results are returned correctly
Example (The same user has been used and is a Power BI Administrator):
Doesn't return data via API (https://docs.microsoft.com/en-us/rest/api/power-bi/admin/getactivityevents#code-try-0)
Return data via Powershell for same period:
The API has the same issue that was logged for the Powershell Activity Events which has been subsequently fixed : https://github.com/microsoft/powerbi-powershell/issues/191
After logging with MS Premier Support their investigation found that currently the RestAPI playground doesn’t support the token continuation logic.
They pointed to blog post that introduced the activity log API:
“As a general rule, regardless of the number of entries returned, if the results include a continuation token, make sure you call the API again with that token to retrieve the remaining data, until a continuation token is no longer returned. It can happen that a call even returns a continuation token without any event entries. But don’t let the absence of activity events distract you. Just keep calling back with that continuation token. Here is how you can code against the continuation token that is returned in the response”
As the playground API didn't work as first assumed we have subsequently implemented using continuation tokens within SSIS to retrieve data from the API.
Some observations of how the API works - during testing we used Fiddler and the results were interesting - it appears for the hour periods you are calling it will call as many continuation tokens. So...
For a 24 hour period (the max the API supports) it will call the API 24 times
For 8am - 8pm it would call 12 times
For 8am to 9:10am it would be called twice
This makes sense why an array returned can be empty and you have to continue calling even though no data is returned it appears to be querying the audit logs for each hour within the parameters passed
Hi @Anonymous,
My Observations after much head banging:
- Query a period greater than 1 hour and you will get no events and a continuation token and uri that will repeat itself forever
- Query for a period of 1 hour and life is good
Process then is for each hour in the time horizon run your get until the continuation tokens end
move on to the next hour
Proud to be a Super User!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
12 | |
2 | |
2 | |
1 | |
1 |