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


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.

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.

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.

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.

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With