Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Export ARM Template for Azure Log analytics Alerts created from Portal

I have created Azure Log Analytics (Monitor) Alert to monitor the Logic App Failures and I have done this using Azure portal. I would like to know how can we export the Alert created from Azure Portal as an ARM template? Anyone know how we can achieve it.

Thanks enter image description here

enter image description here

like image 647
user42012 Avatar asked Dec 31 '22 04:12

user42012


1 Answers

If you want to export the ARM template of the alert in the portal, please follow the steps below.

1.In the portal, navigate to the resource group which the alert located in(Note: It is the group of the alert, not the group of the alert's target resource), select the Show hidden types option -> find your alert and select it -> click Export Template.

enter image description here

2.Click the Download like below, then it will download the template as a compressed file which includes the template.json and parameters.json to local.

enter image description here

Update:

What you are using is legacy Log Analytics Alert, from June 1, 2019, it automatically use new scheduledQueryRules by default in Azure portal, its resource type is microsoft.insights/scheduledqueryrules.

In your case, you could follow this link to switch from the old alert to new one.

Or create a new alert in the portal, navigate to the Log Analytics workspace in the portal -> New alert rule -> Add Custom log search and create it.

enter image description here

Ater create it, in the resource group, select the Show hidden types option, you will find the alert like below, then you can export the template.

enter image description here

like image 144
Joy Wang Avatar answered Mar 09 '23 01:03

Joy Wang