I have a series of metric alerts in azure that I would like to add custom properties to the action group. I have manually added some test data to one of the alerts, and when I use the CLI to pull the details for this alert I can see the data in the returned JSON :
az monitor metrics alert show --resource-group 'MyGroup' --name 'MyAlert'
{
"actions": [
{
"actionGroupId": "/subscriptions/XXX/resourceGroups/MyGroup/providers/microsoft.insights/actionGroups/MyAlert",
"webHookProperties": {
"ResourceName": "MyResourceName",
"TestData": "test"
}
}
],
I am trying to add similar data to other alerts using the update command, but I cant see any examples of how to add these WebHookProperties to existing alerts.
az monitor metrics alert update --resource-group --name 'MyAlert' --add actions ['Test','Test']
Any help is much appreciated!
I am trying to add similar data to other alerts using the update command, but I cant see any examples of how to add these WebHookProperties to existing alerts.
Here is the cmd to update the WebHookProperties
to existing alert.
az monitor metrics alert update --resource-group 'RG-Name' --name 'MyAlert' --set actions[0].webHookProperties='{"ResourceName": "Venkat", "TestData": "Test"}'
Output:
After running the above command, the WebHookProperties are displayed using the cmd below.
az monitor metrics alert show --resource-group 'RG-Name' --name 'MyAlert'
Reference: az monitor metrics alert update