Creating an Azure Action Group is a straightforward process that can be completed in just a few steps. You can create an Action Group in the Azure portal by navigating to the Monitor tab, clicking on Action Groups, and then clicking on the New Action Group button.
To create an Action Group, you'll need to provide a name and description for the group. The name should be unique and descriptive, while the description can be used to provide additional context about the group's purpose.
You can also add multiple action types to an Action Group, including email, SMS, and webhook notifications. This allows you to customize the alerting experience to suit your specific needs.
Action Groups can be used to alert multiple teams or individuals at once, making it easier to manage and resolve incidents.
Creating an Action Group
Creating an Action Group can be a straightforward process, and you have several options to choose from. You can create an action group with a Resource Manager template, which allows you to automatically set up action groups that can be reused in certain types of alerts.
Using a Resource Manager template involves creating a template as a JSON file that describes how to create the action group, and then deploying the template using any deployment method.
To create an action group in the Azure portal, you can follow these steps: log in to the Azure portal, navigate to the Monitor tab, select Alerts, click on Manage action groups, and then click on + New action group to create a new Action Group.
You can also create an action group by providing a name and a short description for the Action Group, selecting the desired notification type(s) such as Email, SMS, Voice, or Webhook, and providing the necessary information for each.
The main.tf file in Terraform contains key components like resource group, action groups, email receivers, SMS receivers, and webhook receivers, which are used to create multiple Azure Monitor Action Groups.
In Terraform, you can configure an email recipient for each action group, assign a name to the recipient of the email, and specify the email address. You can also configure an SMS receiver for each Action Group, assign a name to the SMS recipient, and specify the phone number and country code.
Here are the basic steps to create an action group in the Azure portal:
- Log in to the Azure portal and navigate to the Monitor tab.
- Under Monitor, select Alerts.
- Click on Manage action groups.
- Click on + New action group to create a new Action Group.
- Provide a name and a short description for the Action Group.
- Under the Notifications section, select the desired notification type(s) such as Email, SMS, Voice, or Webhook, and provide the necessary information for each.
- Under the Actions section, select the desired action type(s) such as Azure Function, Logic App, or Automation Runbook, and provide the necessary information for each.
- Click on Create to save the Action Group.
Configuring an Action Group
To configure an Action Group, you'll need to select the Subscription and Resource group where it will be saved. This is a crucial step as it determines where your Action Group will reside within the Azure portal.
You'll then need to enter an Action group name and a Display name. The Display name is used in place of a full action group name when notifications are sent using this group, so choose a name that's easily recognizable.
To add notifications, click the Next: Notifications > button or select the Notifications tab. Here, you'll define a list of notifications to send when an alert is triggered. For each notification, you'll need to provide the following information:
Similarly, to add actions, click the Next: Actions > button or select the Actions tab. Here, you'll define a list of actions to trigger when an alert is triggered. For each action, you'll need to provide the following information:
Remember, you can add multiple actions and notifications to your Action Group, making it a powerful tool for managing alerts and notifications in Azure.
Create a Template
To create a template for your action group, you can use Azure Resource Manager (ARM) templates. These templates allow you to configure your action group automatically and reuse them in certain types of alerts.
You'll need to create a JSON file that describes how to create the action group. This template should define the properties of the action group, such as the name, location, and tags.
Here are the basic steps to create an ARM template:
1. Create a resource of type Microsoft.Insights/actionGroups in your template.
2. Fill in the properties of the action group, such as the name, location, and tags.
3. Define the action group properties, including the action definitions and notification preferences.
Here's an example of the JSON structure for an ARM template resource:
```
{
"type": "Microsoft.Insights/actionGroups",
"apiVersion": "2023-09-01-preview",
"name": "string",
"location": "string",
"tags": {
"key": "value"
},
"properties": {
"actionGroup": {
"name": "string",
"shortName": "string",
"enabled": true,
"emailReceivers": [
{
"name": "string",
"emailAddress": "string"
}
],
"smsReceivers": [
{
"name": "string",
"countryCode": "string",
"phoneNumber": "string"
}
],
"webhookReceivers": [
{
"name": "string",
"uri": "string"
}
]
}
}
}
```
This template defines an action group with email, SMS, and webhook receivers. You can customize this template to fit your specific needs.
To deploy the template, you can use any deployment method, such as Azure PowerShell or the Azure CLI.
Configure
Configuring an action group involves several steps. To start, you need to configure the basic settings of the action group.
First, select the Subscription and Resource group in which the action group is saved. This is a crucial step as it determines the scope of the action group.
Next, enter an Action group name and a Display name. The display name is used in place of a full action group name when notifications are sent using this group.
You can also configure the action group to use secure webhook functionality. To do this, you need to create a Microsoft Entra application for your protected web API and configure it to accept V2.0 access tokens.
Here are the steps to create a Microsoft Entra application for your protected web API:
- Create a Microsoft Entra application for your protected web API. For more information, see Protected web API: App registration.
- Configure your protected web API to be called by a daemon app and expose application permissions, not delegated permissions.
- Configure your protected web API to accept V2.0 access tokens.
To enable the action group to use your Microsoft Entra application, you need to use the PowerShell script that follows this procedure. You must be assigned the Microsoft Entra Application Administrator role to run this script.
To configure the secure webhook action, you need to add the Microsoft Entra Webhook Service Principal as a member of a role on the target Microsoft Entra application that grants access to the target endpoint.
You can also configure notifications and actions for the action group. To configure notifications, define a list of notifications to send when an alert is triggered. To configure actions, define a list of actions to trigger when an alert is triggered.
Here are the steps to configure notifications:
- Click the Next: Notifications > button to move to the Notifications tab, or select the Notifications tab at the top of the screen.
- Define a list of notifications to send when an alert is triggered. Provide the following for each notification:
And here are the steps to configure actions:
- Click the Next: Actions > button to move to the Actions tab, or select the Actions tab at the top of the screen.
- Define a list of actions to trigger when an alert is triggered. Provide the following for each action:
Configure Basic Settings
To configure the basic settings of an action group, you'll need to select the subscription and resource group where it's saved. This is a crucial step to ensure the action group is associated with the correct resources.
First, enter an Action group name, which will serve as the primary identifier for the action group. You'll also need to enter a Display name, which will be used in place of the full action group name when notifications are sent using this group.
The Display name is a key field, as it will be visible to recipients of notifications. Make sure to choose a name that accurately represents the purpose of the action group.
In addition to these basic settings, you may also need to enable a receiver in the action group. This can be done using the az monitor action-group enable-receiver command, which changes the receiver's status from Disabled to Enabled.
To configure an action group's email receiver, you need to enable it first. This can be done by running the command `az monitor action-group enable-receiver`.
You'll need to provide the email address of the receiver, which is a required field. This is done by specifying the `emailAddress` value.
The name of the email receiver must be unique across all receivers within the action group. This is a required field as well, specified by the `name` value.
You can choose to use the common alert schema for the email receiver, which is indicated by the `useCommonAlertSchema` value.
Managing an Action Group
To manage an existing Action Group, log in to the Azure portal and navigate to the Monitor tab. Under Monitor, select Alerts, and then click on Manage action groups. Select the Action Group that you want to manage.
You can make necessary changes to the Notifications and Actions sections. Be sure to click on Save to update the Action Group. This will ensure that the right people are notified when issues arise with your Azure resources.
Here are the steps to manage an existing Action Group in more detail:
- Log in to the Azure portal and navigate to the Monitor tab.
- Under Monitor, select Alerts.
- Click on Manage action groups.
- Select the Action Group that you want to manage.
- Make the necessary changes to the Notifications and Actions sections.
- Click on Save to update the Action Group.
Manage Your
To manage your Action Group, you can log in to the Azure portal and navigate to the Monitor tab. From there, select Alerts and click on Manage action groups. This will allow you to select the Action Group you want to manage and make necessary changes to the Notifications and Actions sections.
The Notifications section is where you can configure who gets notified when an issue arises with your Azure resources. You can add email addresses, phone numbers, or even webhooks to receive notifications. By having the right people notified, you can quickly respond to issues and minimize downtime.
To make changes to an Action Group, follow these steps:
- Log in to the Azure portal and navigate to the Monitor tab.
- Under Monitor, select Alerts.
- Click on Manage action groups.
- Scroll down to the Action Group you want to modify and click on it.
- Make the necessary changes to the Notifications and Actions sections.
- Click on Save to update the Action Group.
By managing your Action Group effectively, you can ensure that the right people are notified when issues arise with your Azure resources. This will help you respond quickly and minimize downtime.
Delete
To delete an action group, you'll need to use the command "az monitor action-group delete." This is a straightforward process that requires you to provide either the --ids argument or other "Resource Id" arguments.
You can delete an action group by specifying one or more resource IDs, which should be space-delimited and include all information of the "Resource Id" arguments. This is a critical step in managing your action groups.
The command to delete an action group is "az monitor action-group delete", which is a simple and efficient way to remove an action group from your system.
Sources
- https://learn.microsoft.com/en-us/azure/azure-monitor/alerts/action-groups
- https://learn.microsoft.com/en-us/cli/azure/monitor/action-group
- https://www.testpreptraining.com/tutorial/create-and-manage-action-groups-in-the-azure-portal/
- https://www.jorgebernhardt.com/terraform-azure-action-groups/
- https://learn.microsoft.com/en-us/azure/templates/microsoft.insights/actiongroups
Featured Images: pexels.com