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