Azure AD Reporting API Wrapper

Azure AD Reporting API Wrapper

I’ve created a simple API wrapper around the Azure Active Directory Graph REST API, covering the reporting portion. I wasn’t planning on doing this (well…again), but I dislike working with raw REST calls or bloated API alternatives.

Azure AD Reporting API Wrapper – Details

Last week I have been playing around with the Azure Active Directory Graph REST API which is very complete and has excellent documentation. For now, I’m only interested in a very small portion of the API. This part is responsible for retrieving Azure AD Audit Report Events, which I would like to use for monitor proposes within an Azure API App.

I was still hoping to find a more managed alternative without the need of including a large amount of external references. Unfortunately, I didn’t find anything of my liking and therefore decided to build my own.

The current release is very simple because of the following;

  • I’m only interested in retrieving AD Reports.
  • I’ve only implemented the “audit-events” report, because I need to listen for “Add” events.

The code sample below can be used to retrieve all audit events for the last 30 days. I’m planning to implement date filters later this week and perhaps event filters (post, because the underlying API does not support this) as well. The GetAuditEvents
result consists out of a collection of .NET objects representing the JSON result.

The solution can be found on GitHib and I’ve published a NuGet package as well.

resources

Post Navigation