See whats changed in Azure using Resource Graph
At work I needed to look and see if it was easy to figure out what resources have changed in Azure, in say the last day, week or month. Now there are multiple ways to do this but the one I like the most is using Azure Resource Graph (which I really like), that and some Kusto Query Language (KQL) and you can find out just about anything you want to about your resources. I’ve used Azure Resource Graph a lot and do workshops on it regularly, not sure why people dont use it more often tbh.
So if I want to see what has changed in a resource group in the last few days its a sample as reading this Microsoft web page: – https://docs.microsoft.com/en-us/azure/governance/resource-graph/how-to/get-resource-changes.
From here we can start to think about the kinds fo queries of interest.
- Show me all of the resources that have been created in the past 7 days.
- Show me the tags for all resources and group them by Tag.
- Show me all resources which havent been tagged.
This is the kind of things that interest me at the moment.
If we have a new subscription we can add a landing zone and add tagging by default to the subscription, the resource group, the resources etc, using Azure policy, which is all fine.
One other thing I like doing is adding a created date Tag to the resources on the day they were created incase I want to know this information at a later stage.
Lets get back to existing subscriptions where we cant add a landing zone for different reasons, I want to know which resources are tagged with a certain tag.
I found this really useful blog from some guy called John Klimster, who I have met in person and is a thoroughly nice chap and has a great blog!
If you’re interested the post I found particularly helpful for working in KQL and using Tags was this one from John.
I’m off to figure out what I need to do which will be hook my queries up to a Logic App and send a report via a schedule of some sort i reckon.
Don’t forget to subscribe to my YouTube Channel.