智能检测 - 故障异常 - 使用 ARM 模板为现有 App Insights 手动创建警报

Smart Detection - Failure Anomalies - Alert create manually using ARM templates for existing App Insights

我几乎没有在过去创建的应用洞察力和警报(智能检测 - 故障异常)。众所周知,"Classic Alert" 将于 2019 年 3 月 31 日退休。

在我的场景中,我想通过 ARM 模板手动创建新警报。以前是 "Failure Anomalies - appinsightname01" of "type": "Microsoft.Insights/alertRules"。此处,appinsightname01 是一个应用洞察名称,此警报是在应用洞察上自动创建的。

现在,8 月 31 日之后这将不再支持,所以我想使用 ARM 模板手动创建新的。

我们创建时支持使用代码 "MetricAlert, AuditLogs, LogSearch" ?

请发表您的看法。 谢谢

感谢您与我们联系!

您可以将以下 ARM 模板用于 Failure Anomalies v2 (non-classic) 警报规则:

{
    "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
    "contentVersion": "1.0.0.0",
    "resources": [
        {
            "type": "microsoft.alertsmanagement/smartdetectoralertrules",
            "apiVersion": "2019-03-01",
            "name": "Failure Anomalies - my-app",
            "properties": {
                  "description": "Detects a spike in the failure rate of requests or dependencies",
                  "state": "Enabled",
                  "severity": "2",
                  "frequency": "PT1M",
                  "detector": {
                  "id": "FailureAnomaliesDetector"
                  },
                  "scope": ["/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/MyResourceGroup/providers/microsoft.insights/components/my-app"],
                  "actionGroups": {
                        "groupIds": ["/subscriptions/00000000-1111-2222-3333-444444444444/resourcegroups/MyResourceGroup/providers/microsoft.insights/actiongroups/MyActionGroup"]
                  }
            }
        }
    ]
}

https://docs.microsoft.com/en-us/azure/azure-monitor/app/proactive-arm-config#failure-anomalies-v2-non-classic-alert-rule

希望对您有所帮助!