← Sentinel query library

Cloud control plane · Microsoft Sentinel

Triage recorded authorization-related management failures

Identify Activity Log failures containing authorization or forbidden outcomes while acknowledging requests rejected before operation start are absent from this source.

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 ActivityStatusValue =~ "Failed"
| extend ErrorCode = coalesce(tostring(Properties_d.statusCode),
    tostring(Properties_d.error.code)),
    FailureDetail = tostring(Properties_d.statusMessage)
| where ActivitySubstatusValue has "Forbidden"
    or ActivitySubstatusValue has "Unauthorized"
    or ErrorCode in~ ("Forbidden", "Unauthorized", "AuthorizationFailed",
        "LinkedAuthorizationFailed", "RequestDisallowedByPolicy")
    or FailureDetail has "AuthorizationFailed"
    or FailureDetail has "LinkedAuthorizationFailed"
    or FailureDetail has "RequestDisallowedByPolicy"
| summarize RecordedFailures = count(),
    Operations = make_set(OperationNameValue, 10),
    Substatuses = make_set(ActivitySubstatusValue, 5),
    ErrorCodes = make_set(ErrorCode, 5),
    ResourceSamples = make_set(coalesce(_ResourceId, ResourceId), 5),
    EventSamples = make_set(EventDataId, 5),
    CorrelationSamples = make_set(CorrelationId, 5),
    FirstSeen = min(TimeGenerated), LastSeen = max(TimeGenerated)
    by WindowStart = bin(TimeGenerated, 1h), SubscriptionId, Caller, CallerIpAddress
| order by RecordedFailures desc, LastSeen desc
| take 200

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

This is a constrained troubleshooting hunt for authorization-related failures that were actually recorded as Azure management operations. It must not be used as a count of every rejected ARM request. Microsoft explicitly states that authentication or authorization rejection before an operation starts does not generate Activity Log records. Such requests cannot appear here, regardless of query tuning. Collection boundary.

Interpret the selected population

The query starts with failed Administrative records. It then looks for forbidden or unauthorized substatus text and selected error identifiers in operation-specific properties. Property shapes are not uniform across providers. Missing or differently encoded errors may be excluded, and the string match is not a universal error parser.

A recorded linked-authorization failure can involve a dependency distinct from the resource shown in the parent operation. A policy denial is also a different control decision from missing RBAC permission. Investigate the original event and provider error rather than treating every returned row as evidence of a stolen credential. Activity schema.

Results are grouped by caller, subscription, reported source address and hour. Counts represent records, which may include retries or duplicate delivery. The sampled operations and resource IDs support a starting investigation; they are not a complete list when a group has more distinct values than the sample caps.

Investigate safely

Resolve the workload owner and examine the intended deployment operation. Check recent role changes, policy assignments, dependency scopes and identity selection. A pipeline that accidentally authenticates as a different principal can fail without any hostile activity. Permission propagation, moved resources and stale deployment templates are other plausible explanations.

For a suspicious caller, correlate identity telemetry and successful management activity independently. Do not claim that a later success is a continuation of these failures merely because it shares an IP address. Shared runners and network address translation can combine unrelated principals.

Validate and tune

Use known historical failures from your own provider and inspect their Properties_d layout before relying on the selection. Test a normal deployment error that should be excluded, a recorded authorization-related failure that should be included, and an early rejected request that legitimately has no Activity Log event.

The threshold is intentionally an inventory ranking, not an alert severity rule. Narrow noisy callers using documented ownership rather than broad permanent suppression. The output cap is 200 groups, with a 24-hour source scan. This read-only recipe was checked against current documentation and has not been tested in a tenant; missing results cannot establish successful authorization or complete rejected-request coverage.

Verify the source

Microsoft references

  1. Microsoft Learn — AzureActivity table ↗
  2. Microsoft Learn — Activity Log scope and limitations ↗
  3. Microsoft Learn — Activity Log event schema ↗
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 →