Forum Discussion
techmonit
Jul 15, 2019Copper Contributor
Powershell to add an action group to alert (Application Insights)
Hi all, Whenever I create a new availability test on Application Insights it creates an alert if X amount of locations test fail, I would like to use this alerts instead of creating new ones but ...
Jul 19, 2019
techmonit Hi, when you create availability test with alert it actually creates metric alert with the same name in the resource group of the application Insights instance
I think there are PowerShell cmdlets currently that you can use to get the alerts and modify them. Of course you have to iterate to every resource group if you have multiple application insights instances. These are the commands:
Other option is to go to the resource group blade. from there you have option for export template. you can grab that template edit it so your alert includes action group (you can remove the other resources that you do not want to modify) and deploy the template. That will modify the alert. Of course you can take that template as well parametrize it so you can apply it to multiple alerts by just changing the input parameters. For example such input parameter could be alert name.
Let me know if that helps you solve your task. In both cases I think you will have to do some code writing to achieve the task.