← Sentinel query library

Identity · Microsoft Sentinel

Investigate managed-identity authentication failures

Find failed managed-identity sign-in records without confusing token acquisition with downstream service authorization.

Before you run

Data & scope

Required tables
AADManagedIdentitySignInLogs
Time window
24 hours
  • Microsoft Entra ID connector with AADManagedIdentitySignInLogs enabled and ingested.
  • Microsoft Entra ID P1 or P2 for sign-in ingestion and query access to the managed-identity 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.
let lookback = 1d;
AADManagedIdentitySignInLogs
| where TimeGenerated >= ago(lookback) and TimeGenerated <= now()
| extend NumericResult = tolong(ResultType)
| where ResultType =~ "Failure"
    or (isnotnull(NumericResult) and NumericResult != 0)
| summarize FailureRecords = count(), FirstSeen = min(TimeGenerated),
    LastSeen = max(TimeGenerated), Descriptions = make_set(ResultDescription, 5),
    SourceIPs = make_set(IPAddress, 10), CorrelationIds = make_set(CorrelationId, 5)
    by AADTenantId, ServicePrincipalId, ServicePrincipalName,
       ResourceDisplayName, ResourceIdentity, ResultType, ResultSignature
| order by FailureRecords desc, LastSeen desc
| take 200

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

Use this hunt to investigate Azure workloads that cannot authenticate with their managed identity. It provides a bounded view of reported sign-in failures and their destinations. A managed identity removes application-managed credentials, but its host, identity selection and permissions can still be misconfigured. Microsoft records these sign-ins separately from ordinary service-principal activity. Managed-identity sign-ins.

Read the result

The query accepts the documented textual Failure value and nonzero numeric result codes when present. Conversion is explicit because ResultType is a string; unfamiliar nonnumeric values remain outside the failure classification. Both the raw result and signature are retained so you can inspect the workspace’s encoding rather than assuming one format. Table schema and numeric conversion.

Each result combines one identity, destination and failure signature across the last day. SourceIPs and CorrelationIds are bounded examples, not complete histories. Use the principal ID to identify the workload rather than relying on a display name that can change. FailureRecords counts matching table rows; the Entra report itself can group sign-ins, so do not equate this number with the report’s displayed row count or the workload’s request count.

Triage and tune

Identify the system-assigned or user-assigned identity and its attached Azure host. Compare the destination with the workload’s documented dependency. Look for host replacement, identity deletion or reassignment, an incorrect user-assigned identity selection, and recent configuration changes. Correlate the first failure with deployment and workload logs.

Distinguish token acquisition from service authorization. A successful managed-identity sign-in does not show that an Azure AI inference request, storage operation or other downstream action was allowed. Check that service’s logs and role assignments separately. Avoid adding broad permissions merely to make a failure disappear.

Limits and validation

This query cannot observe failures that never reach Entra or traffic absent from this connector. A day of silence is not evidence of a healthy application. Confirm ingestion, expected workload activity and the selected workspace. It is a read-only hunting starter checked against documentation, not a tenant-tested detection. Exercise an isolated known failure and recovery before choosing operational thresholds or exclusions.

Verify the source

Microsoft references

  1. Microsoft Learn — AADManagedIdentitySignInLogs schema ↗
  2. Microsoft Learn — Managed-identity sign-in semantics ↗
  3. Microsoft Learn — Microsoft Entra ID connector requirements ↗
  4. Microsoft Learn — Kusto tolong conversion ↗
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 →