Action Group
Introduction
Section titled “Introduction”Azure Monitor Action Groups define a collection of notification preferences and actions to execute when an alert fires. Action Groups are referenced by alert rules such as metric alerts and activity log alerts. They support a variety of notification channels including email, SMS, voice calls, webhooks, and Azure Functions, making them the central dispatch mechanism for Azure Monitor alerts. For more information, see Create and manage action groups.
LocalStack for Azure provides a local environment for building and testing applications that make use of Azure Monitor Action Groups. The supported APIs are available on our API Coverage section, which provides information on the extent of Action Groups’ integration with LocalStack.
Getting started
Section titled “Getting started”This guide walks you through creating an Action Group with an email receiver and associating it with an alert.
Launch LocalStack using your preferred method. For more information, see Introduction to LocalStack for Azure. Once the container is running, enable Azure CLI interception by running:
azlocal start-interceptionThis command points the az CLI away from the public Azure management REST API and toward the LocalStack for Azure emulator API.
To revert this configuration, run:
azlocal stop-interceptionThis reconfigures the az CLI to send commands to the official Azure management REST API.
Create a resource group
Section titled “Create a resource group”Create a resource group to hold all resources created in this guide:
az group create --name rg-monit-demo --location westeurope{ "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-monit-demo", "location": "eastus", "name": "rg-monit-demo", "properties": { "provisioningState": "Succeeded" }, "type": "Microsoft.Resources/resourceGroups"}Create an action group
Section titled “Create an action group”Create an action group with an email receiver as the notification endpoint:
az monitor action-group create \ --name my-action-group \ --resource-group rg-monit-demo \ --short-name myag \ --action email myemail admin@example.com{ "emailReceivers": [ { "emailAddress": "admin@example.com", "name": "myemail", "useCommonAlertSchema": false } ], "groupShortName": "myag", "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-monit-demo/providers/microsoft.insights/actionGroups/my-action-group", "name": "my-action-group", "resourceGroup": "rg-monit-demo", "type": "Microsoft.Insights/ActionGroups"...}Show and list action groups
Section titled “Show and list action groups”Retrieve the details of the action group, then list all action groups in the resource group:
az monitor action-group show \ --name my-action-group \ --resource-group rg-monit-demo{ "emailReceivers": [ { "emailAddress": "admin@example.com", "name": "myemail", "useCommonAlertSchema": false } ], "groupShortName": "myag", "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-monit-demo/providers/microsoft.insights/actionGroups/my-action-group", "name": "my-action-group", "resourceGroup": "rg-monit-demo", "type": "Microsoft.Insights/ActionGroups"...}Then list all action groups in the resource group to confirm it appears:
az monitor action-group list \ --resource-group rg-monit-demo[ { "emailReceivers": [ { "emailAddress": "admin@example.com", "name": "myemail", "useCommonAlertSchema": false } ], "groupShortName": "myag", "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-monit-demo/providers/microsoft.insights/actionGroups/my-action-group", "name": "my-action-group", "resourceGroup": "rg-monit-demo", "type": "Microsoft.Insights/ActionGroups" }]Update an action group
Section titled “Update an action group”Update the action group to add a second email receiver:
az monitor action-group update \ --name my-action-group \ --resource-group rg-monit-demo \ --add-action email newcontact ops@example.com{ "emailReceivers": [ { "emailAddress": "admin@example.com", "name": "myemail", "useCommonAlertSchema": false }, { "emailAddress": "ops@example.com", "name": "newcontact", "useCommonAlertSchema": false } ], "groupShortName": "myag", "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-monit-demo/providers/microsoft.insights/actionGroups/my-action-group", "name": "my-action-group", "resourceGroup": "rg-monit-demo", "type": "Microsoft.Insights/ActionGroups"...}Delete and verify
Section titled “Delete and verify”Delete the resource and confirm it no longer appears in the list:
az monitor action-group delete \ --name my-action-group \ --resource-group rg-monit-demoThen list all action groups to confirm the resource group is now empty:
az monitor action-group list --resource-group rg-monit-demo[]Features
Section titled “Features”- Action group lifecycle: Create, read, list, update, and delete action groups.
- Email receivers: Define one or more email receiver addresses.
- SMS receivers: Define SMS receiver phone numbers.
- Webhook receivers: Define webhook receiver URLs (stored, not invoked).
- Azure app push receivers: Define Azure app push notification receivers.
- Voice receivers: Define voice notification receivers.
- Logic app receivers: Define Logic App action receivers.
- Azure function receivers: Define Azure Function receivers.
- Event hub receivers: Define Event Hub receivers.
- Short name support: Each action group has a short name (max 12 characters) for SMS and push notifications.
Limitations
Section titled “Limitations”- No notifications sent: Emails, SMS messages, voice calls, and push notifications are not dispatched when an alert is triggered.
- No webhook invocation: Webhook URLs are stored but not called.
- No Logic App or Azure Function invocation: Logic App and Azure Function actions are stored but not executed.
- No test alert simulation: The
az monitor action-group testcommand is not supported.
Samples
Section titled “Samples”Explore end-to-end examples in the LocalStack for Azure Samples repository.
API Coverage
Section titled “API Coverage”| Operation ▲ | Implemented ▼ |
|---|