Forum Discussion
Juval
Jun 30, 2020Brass Contributor
Is there a smart way to find out which Action Groups are in which Alerts?
After a while you lose sight if an Action Group is connected to an Alert. Currently i'm not aware of a way to check which Action Groups are linked to which Alerts.
- Jun 30, 2020
Juval if you use resource graph for metric alerts "microsoft.insights/metricalerts"
there is a actiongroupID in the properties section.
Billy York
Jun 30, 2020Iron Contributor
Juval if you use resource graph for metric alerts "microsoft.insights/metricalerts"
there is a actiongroupID in the properties section.
Juval
Jul 01, 2020Brass Contributor
Billy York
Hi,
Thanks for the tip! Thought of sharing if someone else needs the same info. This is what i scrambled up.
Resources
| project
alertName = name,
location,
type,
props = properties
| where type contains "microsoft.insights/activitylogalerts"
| mvexpand actionGroups = parse_json(props["actions"]["actionGroups"])
| extend actionGroup = extract(@"([^\/]+$)",1,tostring(actionGroups.actionGroupId))
| union
(
resources
| project
alertName = name,
location,
type,
props = properties
| where type contains "microsoft.insights/metricalerts"
| mvexpand actionGroups = parse_json(props["actions"])
| extend actionGroup = extract(@"([^\/]+$)",1,tostring(actionGroups.actionGroupId))
)