Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
List out all Azure resources that have Alerts set up (escapes Alert ID to get around issue with spaces)
alerts=$(az resource list --output tsv --resource-type "Microsoft.Insights/metricAlerts" --query [].id)
alerts=${alerts// /SPACEFIX}
for alert in $alerts
do
az resource show --ids "${alert//SPACEFIX/ }" --query properties.scopes[0] --output tsv
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.