SEE WHATS CHANGED IN AZURE USING RESOURCE GRAPH: Part 2
This second part goes a little further than part 1. I could have went about this many ways, but I wanted to use Azure Resource Graph with a Logic App as why not eh?
So I created a dashboard in Azure from the queries I wrote and it looks something like this: –


So from the bottom part which says – Resources thats have No Tags I wanted to email a report to myself every x days.
So I created a Logic App which looks like this:-

Step 1 – is a recurrence trigger of x days
Step 2 – I call the manangement api which is -> https://management.azure.com/providers/Microsoft.ResourceGraph/resources?api-version=2019-04-01
With a JSON Payload like so:-
{
"query": "Resources | join kind=leftouter (ResourceContainers | where type=='microsoft.resources/subscriptions' | project SubName=name, subscriptionId) on subscriptionId | mvexpand tags | extend tagKey = tostring(bag_keys(tags)[0]) | extend tagValue = tostring(tags[tagKey]) | where tagKey == '' and tagValue == '' | order by resourceGroup | project SubName, subscriptionId, name, ['Resource Type']=type, location, resourceGroup, tags",
"subscriptions": [
"subscription id goes here"
]
}
Step 3 – I then parse the JSON which looks like this:-

Step 4 – I use an initialize variable with the sample json returned from the API call in Step 2
Step 5 – I create an HTML Table which formats my results like so:-

Step 6 – I then send the email using whatever you like – I chose SendGrid and that looks like this:-

So every x days I get a report telling me whatever is in the Azure Resource Graph, formatted in an email.
Don’t forget to subscribe to my YouTube Channel.