Deploying incrementally an ARM template with a simple Application Insight resource, is automatically creating FailureAnomaliesDetector alert rule. Which is a problem in case such rule already exists.
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"resources": [
{
"type": "Microsoft.Insights/components",
"apiVersion": "2020-02-02",
"location": "[resourceGroup().location]",
"name": "AiApp",
"kind": "web",
"properties": {
"Application_Type": "web",
"IngestionMode": "ApplicationInsights",
"SamplingPercentage": 12.5,
"publicNetworkAccessForIngestion": "Enabled",
"publicNetworkAccessForQuery": "Enabled"
}
},
{
"type": "microsoft.insights/actionGroups",
"apiVersion": "2019-06-01",
"name": "ActionGroup",
"location": "Global",
"properties": {
"groupShortName": "AiApp",
"enabled": true,
"emailReceivers": "[createObject('emailAddress','john@example.com','name','email','useCommonAlertSchema',true())]"
},
"dependsOn": [ "[resourceId('microsoft.insights/components', 'AiApp')]" ]
},
{
"type": "microsoft.alertsmanagement/smartdetectoralertrules",
"apiVersion": "2021-04-01",
"name": "AlertAnomalies",
"location": "global",
"dependsOn": [ "[resourceId('microsoft.insights/actionGroups', 'ActionGroup')]" ],
"properties": {
"description": "Failure Anomalies notifies you of an unusual rise in the rate of failed HTTP requests or dependency calls.",
"state": "Enabled",
"severity": "Sev2",
"frequency": "PT1M",
"detector": {
"id": "FailureAnomaliesDetector"
},
"scope": [ "[resourceId('microsoft.insights/components', 'AiApp')]" ],
"actionGroups": {
"groupIds": [ "[resourceId('microsoft.insights/actionGroups', 'ActionGroup')]" ]
}
}
}
]
}
I was not able to find any hint in the documentation to stop it creating for my case unwanted rule. Any Idea?