← Sentinel query library

Cloud control plane · Microsoft Sentinel

Review Azure role-assignment changes

Inspect recorded role-assignment writes and deletes, preserving operation status, caller and correlation evidence.

Before you run

Data & scope

Required tables
AzureActivity
Time window
7 days
  • Azure Activity connector or subscription diagnostic settings exporting Administrative events to this workspace.
  • Query access to AzureActivity and coverage of each subscription under investigation.

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.
let lookback = 7d;
AzureActivity
| where TimeGenerated >= ago(lookback) and TimeGenerated <= now()
| where CategoryValue =~ "Administrative"
| where OperationNameValue in~ (
    "Microsoft.Authorization/roleAssignments/write",
    "Microsoft.Authorization/roleAssignments/delete")
| extend AuthorizationScope = tostring(Authorization_d.scope),
    AffectedResource = coalesce(ResourceId, _ResourceId)
| project TimeGenerated, SubscriptionId, Caller, CallerIpAddress,
    OperationNameValue, ActivityStatusValue, ActivitySubstatusValue,
    AffectedResource, AuthorizationScope, CorrelationId, OperationId,
    EventDataId, Properties_d
| order by TimeGenerated desc
| take 200

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

Use this hunt to review recorded attempts to create or delete Azure resource-role assignments. It is useful after an unexpected access change or during a review of deployment identities. The selected operation identifiers are documented Azure RBAC actions, not a search for a localized display label. RBAC change history.

Read the result

The query preserves all recorded statuses. A Started or failed row is not evidence that access was granted or removed. One operation can generate several events; use the operation and correlation identifiers to reconstruct its lifecycle and confirm the terminal outcome. Requests rejected before an administrative operation starts are not necessarily recorded here. Activity Log semantics.

Caller identifies the initiator, not automatically the principal receiving access. AuthorizationScope is extracted from the documented dynamic authorization bag. It describes the authorization context and should not be mistaken for a complete entitlement calculation. AffectedResource prefers the resource ID and falls back to the resource identifier column. Keep Properties_d for inspection without assuming that every event contains a request body with the same nested fields. Log Analytics schema.

Triage and tune

Resolve the affected assignment to its actual principal, role definition, scope and any condition. Compare the request with an approved change, deployment run or access-management process. Review whether inherited assignments already provided similar access, and whether subsequent operations used the new authority. For deleted assignments, verify the effective access outcome rather than assuming every route was removed.

Routine infrastructure deployment and access lifecycle operations can produce many legitimate entries. Narrow to investigated subscriptions, callers or scopes only after confirming their exact values. The latest 200 events are a navigation aid; use smaller time windows to review a complete high-volume interval.

Limits and validation

This query covers resource-role assignments, not Entra directory roles, custom role-definition edits, every privileged-access workflow or a current access inventory. Export gaps can hide entire subscriptions. It is read-only and documentation-checked, with no tenant execution or validated detection claim. Confirm ingestion and compare an authorized test assignment change with its expected Activity Log records before operational use.

Verify the source

Microsoft references

  1. Microsoft Learn — AzureActivity table schema ↗
  2. Microsoft Learn — Azure RBAC change activity ↗
  3. Microsoft Learn — Azure Activity Log event semantics ↗
  4. Microsoft Learn — Diagnostic settings-based Sentinel connections ↗
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 →