Sasha
Sasha

Reputation: 1

How to enable Azure "Daily anomaly by resource group" alert using ARM template?

I have Anomaly Cost Detection alert created in Azure Subscription -> Cost Management -> Cost Alerts. The alert was created manually via Azure Portal. As I have created an ARM template that will deploy few other "standard Azure Monitor" alerts upon creation of Azure Subscription, I want to find a way to enable/disable this alert using ARM template so that I can include it in the list.

What I understood is that the alert is extension and cannot exist as a resource by itself, and the documentation states that needs to be attached to other resource. Does anyone have an idea to which one? Also, the documentation states "To create a Microsoft.CostManagement/alerts resource, add the following JSON to your template.", can anyone suggest a template where I can indeed add this resource? MS Docs Link: https://learn.microsoft.com/en-us/azure/templates/microsoft.costmanagement/2019-11-01/alerts?pivots=deployment-language-arm-template

Upvotes: 0

Views: 584

Answers (1)

Sasha
Sasha

Reputation: 1

I have found a solution to the issue, namely a different type of resource provider was needed. The correct template to use is documented here.

The bicep version might be easier to use, but I have managed to deploy this template using AzureResourceManagerTemplateDeployment task in Azure DevOps pipeline.

Upvotes: 0

Related Questions