← Sentinel query library

Cloud control plane · Microsoft Sentinel

Investigate Azure Policy assignment and exemption changes

Review successful assignment and exemption mutations with their resource scopes and initiating callers, then verify the effective policy outcome separately.

Before you run

Data & scope

Required tables
AzureActivity
Time window
24 hours
  • Azure Activity export from the relevant subscriptions to AzureActivity in this workspace.
  • Query access and at least 24 hours of retained Administrative activity; portal Activity Log alone does not populate this table.

Documentation review by Codex (AI). No live-tenant execution or detection-performance claim. Validate schema, data coverage and expected results in your workspace.

Kusto Query Language
Download .kql
// Hunting starter. Documentation checked 2026-11-13; not tenant-tested.
AzureActivity
| where TimeGenerated >= ago(1d) and TimeGenerated <= now()
| where CategoryValue =~ "Administrative"
| where OperationNameValue in~ (
    "Microsoft.Authorization/policyAssignments/write",
    "Microsoft.Authorization/policyAssignments/delete",
    "Microsoft.Authorization/policyExemptions/write",
    "Microsoft.Authorization/policyExemptions/delete")
| where ActivityStatusValue =~ "Succeeded"
| extend ChangeClass = case(
    OperationNameValue has "policyExemptions", "Exemption mutation",
    "Assignment mutation")
| project TimeGenerated, ChangeClass, OperationNameValue,
    SubscriptionId, ResourceGroup, ResourceId = coalesce(_ResourceId, ResourceId),
    Caller, CallerIpAddress, ActivityStatusValue,
    EventDataId, CorrelationId, OperationId
| order by TimeGenerated desc
| take 200

Read-only query. Run in your own authorized workspace after checking prerequisites.

Use this hunt to identify changes that may alter how preventive and audit policies apply to AI infrastructure. It selects successful writes and deletions for policy assignments and exemptions. The operation names come from Microsoft’s management and governance permissions reference; the query does not infer policy effects from a display name.

Establish what changed

A write can create an object or update an existing object. An exemption may be legitimate, temporary and narrowly scoped, while an assignment update may strengthen a control. Therefore, “mutation” is the appropriate output classification. The presence of a row is a reason to inspect the object and change evidence, not a finding that governance was weakened.

Recover the approved before-and-after assignment or exemption definition from your change system. Compare its scope, excluded scopes, parameters, referenced definition or initiative, enforcement choices and expiration information. Then identify which resources depend on the resulting control. The query intentionally avoids inventing those properties from the generic activity record.

Management-group coverage needs particular care. Subscription exports do not automatically prove that all ancestor-scope changes were collected. Inventory the scopes routed into the workspace and investigate gaps before interpreting silence. AzureActivity fields and scope.

Connect the change to a security decision

For an AI service, prioritize controls that govern public networking, approved locations, diagnostic collection, identity and storage exposure. Check whether a new exception permits a previously denied deployment or only suppresses compliance evaluation. Preserve the justification, risk owner, expiry date and compensating measures.

Resolve the initiating caller and verify its approved role in the deployment workflow. A familiar automation identity still needs a legitimate change record. An emergency exemption can be justified, but should have explicit reversal evidence and an owner who remains accountable after the incident.

Tune and validate

Bulk policy initiatives, landing-zone rollouts and exception renewals can create many valid events. Group related rows using correlation evidence during investigation rather than silently reducing the inventory to one row per caller. Missing or reused correlation identifiers require additional context.

Validate with an approved historical assignment update and an exemption renewal, confirming the expected operation names and scopes. Review deletion separately because it can either remove protection or remove an exception. Results are capped at 200 rows over 24 hours. This recipe is documentation-checked, not tenant-tested; its output does not measure compliance or prove that a policy was evaluated successfully against every affected resource.

Verify the source

Microsoft references

  1. Microsoft Learn — AzureActivity table ↗
  2. Microsoft Learn — Management and governance permissions ↗
Before turning a hunt into an alert

Measure normal activity, validate known test cases, account for ingestion delays, choose a threshold and entity mapping, and assign an owner. Results require investigation.

Follow the detection learning path →