Reputation: 11
I'm looking for a way to query Microsoft Purview Audit Logs programmatically using C# or API to retrieve PowerApps launch events and Power Automate flow run statuses.
I found that the new Purview portal (https://purview.microsoft.com/audit/auditsearch) provides audit logs, including PowerApps Launch logs. However, the portal processes queries in the background as a job and makes results available after a few hours on the portal.
Instead of manually searching in the Purview portal, I want to programmatically query these logs using an API in C#.
Is there a REST API or Graph API endpoint to retrieve these audit logs from Microsoft Purview for getting logs for Power Apps and Flows?
If yes, what are the authentication requirements on service principle?
Are there any C# SDKs or libraries that simplify querying Purview audit logs for Power Platform?
Checked following Microsoft Graph API, but doesn't return data for Power Apps and Flow logs.
https://graph.microsoft.com/beta/auditLogs/directoryAudits"
Looked at Microsoft Compliance Center Audit Log Search, but it seems limited in automation.
Found Exchange Online PowerShell cmdlets (Search-UnifiedAuditLog
), but it doesn't return all the required logs (like flow run log, app launch), and also looking for API solution.
Any guidance, documentation, or sample C# code would be greatly appreciated!
I tried API endpoint
https://graph.microsoft.com/beta/auditLogs/directoryAudits"
and PowerShell module
Search-UnifiedAuditLog
but did not get required information like Flow runs log, App Launch log.
Upvotes: 1
Views: 53