Forum Discussion

Juval's avatar
Juval
Brass Contributor
Jun 30, 2020
Solved

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.

  • Juval if you use resource graph for metric alerts "microsoft.insights/metricalerts"

    there is a actiongroupID in the properties section.

2 Replies

  • Billy York's avatar
    Billy York
    Iron Contributor

    Juval if you use resource graph for metric alerts "microsoft.insights/metricalerts"

    there is a actiongroupID in the properties section.

    • Juval's avatar
      Juval
      Brass 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))
          )

Resources