Created
February 1, 2022 08:55
-
-
Save eosfor/aec0f04a301e6278ff0b635c61f89078 to your computer and use it in GitHub Desktop.
pill alert rules and their action groups from azure where action groups have a webhook attached
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$q = "resources | |
| where type == `"microsoft.insights/metricalerts`" | |
| extend prop = parse_json(properties) | |
| extend agId = tolower(tostring(prop.actions[0].actionGroupId)) | |
| project metricsid = ['id'], mname = name, mresourceGroup = resourceGroup, agId | |
| join kind = inner ( resources | |
| where type == `"microsoft.insights/actiongroups`" | |
| extend prop = parse_json(properties) | |
| project actiongroupid = tolower(id), aname = name, aresourcegroup = resourceGroup, whURL = tostring(prop.webhookReceivers[0].serviceUri) | |
| where whURL != `"`") | |
on `$left.agId == `$right.actiongroupid | |
" | |
Search-AzGraph -Query $q |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment