Skip to content

Instantly share code, notes, and snippets.

@ehrnst
Created March 14, 2022 14:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ehrnst/4fd80aa4153e4f3b000033a9360437ef to your computer and use it in GitHub Desktop.
Save ehrnst/4fd80aa4153e4f3b000033a9360437ef to your computer and use it in GitHub Desktop.
Azure resource graph resource changes
// get latest resource changes based on resource group tag
resourcechanges
| join kind= inner (
resourcecontainers
| where type =~ 'microsoft.resources/subscriptions/resourcegroups'
| where isnotempty(tags)
| where tags['key'] =~ 'value'
| project subscriptionId, resourceGroup)
on subscriptionId, resourceGroup
| extend changeTime = todatetime(properties.changeAttributes.timestamp),
changedResourceId = tostring(properties.targetResourceId),
changes = tostring(properties.changes),
changeType= tostring(properties.changeType)
| project-away subscriptionId1, resourceGroup1
| project changeTime, changeType, changedResourceId, changes
| order by changeTime desc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment