← Sentinel query library

Cloud control plane · Microsoft Sentinel

Find management callers absent from the previous seven days

Compare successful recent Azure management callers with a separate historical window, scoped by subscription and normalized caller identifier.

Before you run

Data & scope

Required tables
AzureActivity
Time window
24-hour investigation window plus the preceding 7-day baseline
  • Azure Activity export for all investigated subscriptions, with eight days retained in AzureActivity.
  • Query access and an Analytics plan supporting materialize and joins; verify continuous export before interpreting a missing baseline.

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 investigationStart = ago(1d);
let activity = materialize(
    AzureActivity
    | where TimeGenerated >= investigationStart - 7d and TimeGenerated <= now()
    | where CategoryValue =~ "Administrative"
    | where ActivityStatusValue =~ "Succeeded"
    | extend CallerKey = tolower(Caller), SubscriptionKey = tolower(SubscriptionId)
    | where isnotempty(CallerKey) and isnotempty(SubscriptionKey)
    | project TimeGenerated, CallerKey, SubscriptionKey, OperationNameValue,
        CallerIpAddress, ResourceId = coalesce(_ResourceId, ResourceId), CorrelationId
);
let prior = activity
    | where TimeGenerated < investigationStart
    | summarize PriorRows = count(), PriorLastSeen = max(TimeGenerated)
        by SubscriptionKey, CallerKey;
activity
| where TimeGenerated >= investigationStart
| summarize RecentRows = count(), FirstSeen = min(TimeGenerated), LastSeen = max(TimeGenerated),
    Operations = make_set(OperationNameValue, 10),
    ResourceSamples = make_set(ResourceId, 5),
    IpSamples = make_set(CallerIpAddress, 5), CorrelationSamples = make_set(CorrelationId, 5)
    by SubscriptionKey, CallerKey
| join kind=leftouter prior on SubscriptionKey, CallerKey
| where isnull(PriorRows)
| extend BaselineFinding = "Caller absent from available prior 7-day records"
| project FirstSeen, LastSeen, SubscriptionKey, CallerKey, BaselineFinding,
    RecentRows, Operations, ResourceSamples, IpSamples, CorrelationSamples
| order by RecentRows desc, LastSeen desc
| take 200

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

This query asks a narrow behavioral question: which callers completed recorded management operations in the last 24 hours without appearing in the preceding seven days of available successful Administrative activity for the same subscription? It does not identify newly created identities or prove that the caller has never operated there before.

Protect the baseline from self-confirmation

The windows are disjoint. Recent events cannot establish their own historical precedent. The recent side is summarized before the explicit left-outer join, reducing repeated comparison work while retaining samples of operations, resources and addresses.

Both subscription and caller are normalized to lowercase. The caller field can represent different identity forms depending on the event; normalization does not resolve an email-like name to an immutable directory object. An identity rename or changed claim representation can therefore produce a new key. Blank callers are excluded from this particular comparison and should be investigated with a separate completeness view. AzureActivity field contract.

The output deliberately says “absent from available records.” A newly enabled export, missing subscription, retention gap or quiet maintenance schedule can explain absence. The query cannot prove historical completeness from the records it sees.

Investigate the introduction of authority

Determine whether the caller belongs to a newly onboarded workload, a migrated pipeline or an emergency responder. Compare its first observed action with the identity’s ownership, role assignment and approved deployment history. Prioritize high-impact operations and sensitive dependencies instead of using row volume as a substitute for business risk.

An existing identity may be used from a new automation system without being newly privileged. Conversely, an identity that already appears in the baseline can still abuse newly granted authority and will not be returned. Pair this view with permission-change and operation-specific hunts.

Tune and validate

Choose a baseline that spans the actual maintenance cycle. Seven days will flag monthly jobs; extending to thirty days raises retention and scan requirements. Consider separately reviewed expectations for scheduled jobs rather than permanently accepting every caller after its first appearance.

Validate one established caller, one known newly onboarded caller and one deliberately incomplete test dataset. Confirm that a recent event cannot enter the prior window and that activity in one subscription does not suppress a result in another. Large workspaces should first restrict subscription scope.

Azure management logs also have collection limits, including early authorization rejection and data-plane omissions. Activity Log coverage. This recipe is documentation-checked, not tenant-tested, and returns at most 200 caller/subscription pairs without assigning malicious intent.

Verify the source

Microsoft references

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