Using Console
Using CLI
az login
az account set --subscription <subscription-id>
Replace <subscription-id>
with the ID of the subscription you want to select.
az monitor activity-log alert create --name <alert-name> --description <alert-description> --condition category=ServiceHealth severity=warning --action email <email-address>
Replace <alert-name>
with the name of the alert you want to create, <alert-description>
with the description of the alert, and <email-address>
with the email address where you want to receive the alert notifications.
az monitor activity-log alert update --name <alert-name> --enable true
Replace <alert-name>
with the name of the alert you created in step 3.
az monitor activity-log alert show --name <alert-name>
Replace <alert-name>
with the name of the alert you created in step 3.
Using Python
MonitorManagementClient
object: