An Azure service that is used to provision Windows and Linux virtual machines.
Azure Resource Graph resourcechanges: duplicate "Create" records for disks and snapshots, one with an empty correlationId
Hello,
My team is building a report of manual changes (made by users from the portal, CLI or PowerShell) on top of resourcechanges in Azure Resource Graph. For Microsoft.Compute/disks and Microsoft.Compute/snapshots we get two Create records for a single operation, one of them with an empty correlationId.
Example (snapshot created from the Azure portal)
timestamp (UTC) changeType correlationId changesCount
12:11:24 Create a8e41fa3-xxxx-xxxx-xxxx-xxxxxxxxxxxx 0
12:21:24 Create 00000000-0000-0000-0000-000000000000 0
Both records have the same operation (Microsoft.Compute/snapshots/write), changedBy, clientType, changes = {} and previousResourceSnapshotId = null. The Activity Log shows a single Create or Update Snapshot operation and no write at the time of the second record.
Observations (tenant-wide, last 30 days)
- Records with an all-zero
correlationIdexist for many resource types. Zero-correlationCreaterecords appear almost only on disks and snapshots. - When both records exist, they are usually about 10 minutes apart, in either order.
- Some resources have only the zero-correlation
Create, with noCreatecarrying a real correlationId.
Current query
resourcechanges
| extend ChangedAt = todatetime(properties.changeAttributes.timestamp),
ChangedByType = tostring(properties.changeAttributes.changedByType),
ChangedBy = tostring(properties.changeAttributes.changedBy),
ClientType = tostring(properties.changeAttributes.clientType),
CorrelationId = tostring(properties.changeAttributes.correlationId),
ChangeType = tostring(properties.changeType),
ResourceId = tostring(properties.targetResourceId)
| where ChangedAt > ago(30d)
| where ChangedByType =~ "User"
| project ChangedAt, ChangedBy, ClientType, CorrelationId, ChangeType, ResourceId
Questions
- What is the recommended way to adjust this query so that each manual operation is reported once?
- What does the all-zero
correlationIdrepresent, and is it safe to filter it out or to deduplicate ontargetResourceId+changeType? - Is the duplicate
Createexpected behavior for disks and snapshots?
Thank you