Before you run
Data & scope
- Required tables
- Time window
- 24 hours; 15-minute activity groups
- Blob service diagnostic settings sending StorageRead, StorageWrite and StorageDelete logs to the resource-specific StorageBlobLogs table.
- Query access and retained coverage for the investigated storage accounts; management-plane AzureActivity is not a substitute for Blob request logs.
Documentation review by Codex (AI). No live-tenant execution or detection-performance claim. Validate schema, data coverage and expected results in your workspace.
// Hunting starter. Documentation checked 2026-11-13; not tenant-tested.
StorageBlobLogs
| where TimeGenerated >= ago(1d) and TimeGenerated <= now()
| where AuthenticationType =~ "AccountKey"
| extend HttpStatus = toint(StatusCode),
Successful = toint(StatusCode) between (200 .. 299)
| summarize ObservedRequests = count(), SuccessfulRequests = countif(Successful),
DeniedRequests = countif(HttpStatus in (401, 403)),
OtherStatusRequests = countif(isnull(HttpStatus)
or (not(Successful) and HttpStatus !in (401, 403))),
SuccessfulResponseBytes = sumif(ResponseBodySize, Successful),
ObjectEstimate = dcount(iff(isnotempty(ObjectKey), pack_array(ObjectKey), dynamic(null))),
Operations = make_set(OperationName, 15), StatusEvidence = make_set(StatusText, 10),
ObjectSamples = make_set(ObjectKey, 3), CorrelationSamples = make_set(CorrelationId, 3),
FirstSeen = min(TimeGenerated), LastSeen = max(TimeGenerated)
by WindowStart = bin(TimeGenerated, 15m), _ResourceId, AccountName,
Category, CallerIpAddress, UserAgentHeader
| extend SuccessfulResponseMiB = round(todouble(SuccessfulResponseBytes) / 1048576.0, 2)
| project WindowStart, FirstSeen, LastSeen, _ResourceId, AccountName, Category,
CallerIpAddress, UserAgentHeader, ObservedRequests, SuccessfulRequests,
DeniedRequests, OtherStatusRequests, SuccessfulResponseMiB, ObjectEstimate,
Operations, StatusEvidence, ObjectSamples, CorrelationSamples
| order by SuccessfulRequests desc, SuccessfulResponseMiB desc, LastSeen desc
| take 200
Read-only query. Run in your own authorized workspace after checking prerequisites.
Use this hunt to identify Blob workloads still presenting account keys and to investigate unexpected activity through that authorization path. It groups AccountKey requests by storage resource, operation category, client IP and user-agent string. This supports both incident triage and a planned migration away from broad shared credentials.
The filter intentionally excludes SAS. Azure Storage distinguishes account-key authorization from SAS requests, and a SAS can use different signing mechanisms. Treating every SAS request as evidence of account-key usage would overstate the finding. This recipe is a focused AccountKey inventory, not complete coverage of every access path affected by a Shared Key policy change. Shared Key authorization guidance.
Read the access evidence
SuccessfulRequests counts HTTP 2xx responses, including partial-content responses. DeniedRequests counts 401 and 403. OtherStatusRequests retains other statuses and nonnumeric values instead of converting them into successful access. Request counts describe observed log rows; they do not establish unique clients or unique objects.
SuccessfulResponseMiB sums response-body sizes for successful requests in the group. It is useful for comparing activity, but it is not a measurement of unique data exfiltrated. Retries, repeated reads, range requests and non-content responses affect the total. A response to a write is also different from the request body uploaded by that write.
ObjectEstimate is an approximate count of nonempty object keys. The sample keys and correlation IDs help locate original events; they intentionally do not include complete request URIs, which deserve careful handling in investigation records. A missing size or object identifier limits interpretation rather than proving that no data moved. Storage log fields.
CallerIpAddress can include a port. The query preserves the original value, so changing client ports can split otherwise related activity. Do not remove text after the first colon: that would corrupt IPv6 addresses. Any normalization should be validated against the actual address formats. A user-agent label is client-supplied context, not authenticated ownership.
Investigate the workload
Resolve the storage account and affected objects to their data owner. Match the source and client pattern to a known application, backup, migration or administrative tool. Shared-key authorization does not reliably identify the individual human or process holding the key. Use application logs, deployment configuration and credential distribution records to establish attribution.
Investigate an unexplained source, unexpected objects, or activity outside the workload’s normal purpose. Preserve evidence before changing a credential. A planned move to Entra authorization should account for dependencies and rollback; this read-only query neither rotates keys nor disables an authorization method.
Tune and validate
Backups, batch processing, storage explorers and legacy integration jobs are frequent legitimate matches. Tune around an owned workload and its intended access pattern rather than permanently excluding a broad network range. The 15-minute groups and latest 200 ranked results can hide low-volume activity in a busy account; narrow the resource and time window when reviewing a specific incident.
Confirm diagnostic collection for read, write and delete categories on each Blob service. Storage resource logging must be configured to reach the workspace; Azure Activity coverage alone does not show Blob data access. Blob monitoring configuration.
This hunt is documentation-checked and has not been tenant-tested. Validate an authorized account-key request and an Entra-authorized comparison request, and confirm only the intended authorization type matches.
Verify the source
Microsoft references
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 →