Use Resource Graph to identify what resources are configured for alerts and notifications?

feelsLikeHome2020 21 Reputation points
2022-02-17T19:33:13.423+00:00

Is there a way to use Resource Graph query to retrieve what alerts are configured for resources, and who the alert notification would get sent to? Not looking to retrieve the actual alerts. There are several resource groups for which we want to retrieve this. Thanks for any insights

Azure Monitor
Azure Monitor
An Azure service that is used to collect, analyze, and act on telemetry data from Azure and on-premises environments.
3,256 questions
Azure Network Watcher
Azure Network Watcher
An Azure service that is used to monitor, diagnose, and gain insights into network performance and health.
169 questions
Azure Kubernetes Service (AKS)
Azure Kubernetes Service (AKS)
An Azure service that provides serverless Kubernetes, an integrated continuous integration and continuous delivery experience, and enterprise-grade security and governance.
2,103 questions
0 comments No comments
{count} votes

Accepted answer
  1. SwathiDhanwada-MSFT 18,756 Reputation points
    2022-02-21T01:20:01.417+00:00

    @feelsLikeHome2020 Welcome to Microsoft Q & A Community Forum. I understand that you are trying to retrieve the list of alerts that are configured on the resources along with the actionGroups.

    Here is a sample kusto query that will retreive the requested results.

    Resources  
    | where type=='microsoft.insights/metricalerts'  
    | project name , type , resourceGroup , actionGroups = properties.actions ,scopes = properties.scopes  
    | mv-expand actionGroups   
    | extend actionGroupId = tostring(actionGroups.actionGroupId)  
    | join kind=inner (  
      Resources | where type == 'microsoft.insights/actiongroups'  
      | project actionGroupId= tostring(id), name, type , properties  
    ) on actionGroupId  
    | project-away actionGroups  , actionGroupId1 , name1 , type1  
    

    This query projects below information

    • name : Name of the metric alert
    • type : specifies the type of alert
    • resourceGroup : resourceGroup of the alert where it exists
    • scopes : list of resources where the alert is configured
    • actionGroupId : Id of the action group that is linked to alert
    • properties : contains the collections of notifications preferences.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.