Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save andrewmatveychuk/dbe46caabe9b89df1cc6c338600b927b to your computer and use it in GitHub Desktop.
Save andrewmatveychuk/dbe46caabe9b89df1cc6c338600b927b to your computer and use it in GitHub Desktop.
Get all active alerts in a resource group
alertsmanagementresources
| where properties.essentials.targetResourceGroup =~ 'your_resource_group_name'
| where properties.essentials.monitorCondition =~ 'Fired'
| extend severity = tostring(properties.essentials.severity),
alertCondition = tostring(properties.essentials.monitorCondition),
userResponse = tostring(properties.essentials.alertState),
targetResource = tostring(properties.essentials.targetResource),
fireTime = todatetime(properties.essentials.startDateTime)
| order by fireTime desc
| project name, severity, alertCondition, userResponse, targetResource, fireTime, properties
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment