Implementation for Azure Monitor Alerts
Create the infrastructure:
cp config/sample.tfvars .auto.tfvars
Create the infrastructure:
terraform init
terraform apply -auto-approve
Upload blobs to trigger the alarm:
az storage blob upload \
--account-name <storage-account> \
--container-name blobs \
--name test.txt \
--file test.txt \
--auth-mode login
One option is to create an alert when a lock is created.
To achieve that, select the desired scope, and in the Alert Rule, select the Signal named Add management locks (Management lock)
.
Alerts can also be sent to sent via push notification to the Azure mobile app in the Action Group by identifying the user account email.
az monitor action-group create --name ContosoWebhookAction \
--resource-group ContosoVMRG \
--action azureapppush test_apppush bob@contoso.com