santosh gaikwad
santosh gaikwad

Reputation: 11

How to Query Microsoft Purview Audit Logs via API in C# for PowerApps and Power Automate Logs?

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#.

Questions:

  1. 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?

  2. If yes, what are the authentication requirements on service principle?

  3. Are there any C# SDKs or libraries that simplify querying Purview audit logs for Power Platform?

What I have tried:

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

Answers (0)

Related Questions