Architecture

Scheduled reports with Microsoft Graph

Reports run on a schedule in Azure Automation, sign in with a managed identity or a certificate, read from Microsoft Graph and Exchange Online, and deliver results by email or to a SharePoint library.

Flow

AzureMicrosoft 365Team1ScheduleDaily2RunbookManaged identity3Microsoft GraphLeast privilege4Build reportCSV, HTML5Mail or SharePointDelivered

Design decisions

  • Grant application permissions only for what the report reads.
  • Restrict Mail.Send to one mailbox.
  • Alert when a report returns zero rows.

Scripts for this design