output "workspace_id" { description = "The workspace containing the Microsoft 365 audit records." value = azurerm_log_analytics_workspace.m365.id } output "verify" { description = "How to prove each alert fires." value = <<-EOT Records are flowing when this returns a recent time for each workload: az monitor log-analytics query -w ${azurerm_log_analytics_workspace.m365.workspace_id} --analytics-query "OfficeActivity | summarize max(TimeGenerated) by OfficeWorkload" In Outlook on the web, on a test mailbox, add an inbox rule that forwards to an outside address, then delete it. m365-mail-forwarded follows once the record arrives. Add-MailboxPermission -Identity -User -AccessRights FullAccess, then remove it. m365-mailbox-access-granted follows. After the first day, check what the records cost: OfficeActivity | summarize GB = sum(_BilledSize) / 1e9 by _IsBillable Each alert's description names its saved query in the workspace, under the category Identity provider signals. EOT }