To create or edit an alert rule, you must have the following permissions:
Read permission on the target resource of the alert rule.
Write permission on the resource group in which the alert rule is created. If you're creating the alert rule from the Azure portal, the alert rule is created by default in the same resource group in which the target resource resides.
Read permission on any action group associated to the alert rule, if applicable.
When you create a metric alert on a single resource, the syntax uses the TargetResourceId. When you create a metric alert on multiple resources, the syntax contains the TargetResourceScope, TargetResourceType, and TargetResourceRegion.
Create a new resource, using the following resource types:
For metric alerts: Microsoft.Insights/metricAlerts
Note
We recommend that you create the metric alert using the same resource group as your target resource.
Metric alerts for an Azure Log Analytics workspace resource type (Microsoft.OperationalInsights/workspaces) are configured differently than other metric alerts. For more information, see Resource Template for Metric Alerts for Logs.
If you are creating a metric alert for a single resource, the template uses the ResourceId of the target resource. If you are creating a metric alert for multiple resources, the template uses the scope, TargetResourceType, and TargetResourceRegion for the target resources.
For log search alerts: Microsoft.Insights/scheduledQueryRules
For activity log, service health, and resource health alerts: microsoft.Insights/activityLogAlerts
Copy one of the templates from these sample ARM templates.
In this module, you learn how Azure Monitoring alerts proactively notifies you when Azure Monitor data indicates there might be a problem with your infrastructure or applications before the problem becomes one for your users.