使用ARM模板的应用程序见解警报 [英] Application insights alerts using ARM templates

查看:90
本文介绍了使用ARM模板的应用程序见解警报的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用ARM模板配置应用程序洞察警报.我已将以下内容用于服务器响应时间警报;

I'm trying to configure application insights alerts using ARM templates. I have used the following for a server response time alert;

{
      "name": "[variables('responseAlertName')]",
      "type": "Microsoft.Insights/alertrules",
      "apiVersion": "2014-04-01",
      "location": "[parameters('location')]",
      "dependsOn": [
        "[resourceId('Microsoft.Insights/components', parameters('components_appinsights_name'))]"
      ],
      "tags": {
        "[concat('hidden-link:', resourceId('Microsoft.Insights/components', parameters('components_appinsights_name')))]": "Resource"
      },
      "properties": {
        "name": "[variables('responseAlertName')]",
        "description": "response time alert",
        "isEnabled": true,
        "condition": {
          "$type": "Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.ThresholdRuleCondition, Microsoft.WindowsAzure.Management.Mon.Client",
          "odata.type": "Microsoft.Azure.Management.Insights.Models.ThresholdRuleCondition",
          "dataSource": {
            "$type": "Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.RuleMetricDataSource, Microsoft.WindowsAzure.Management.Mon.Client",
            "odata.type": "Microsoft.Azure.Management.Insights.Models.RuleMetricDataSource",
            "resourceUri": "[resourceId('microsoft.insights/components', parameters('components_appinsights_name'))]",
            "metricName": "request.duration"
          },
          "threshold": "10",
          "windowSize": "PT5M"
        },
        "actions": [
          {
            "$type": "Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.RuleEmailAction, Microsoft.WindowsAzure.Management.Mon.Client",
            "odata.type": "Microsoft.Azure.Management.Insights.Models.RuleEmailAction",
            "sendToServiceOwners": true,
            "customEmails": []
          }
        ]
      }
    }

但是问题是它正在作为门户中的经典"警报添加.应该如何更改模板,以便将警报添加为新警报而不是传统警报?

But the issue is it's being added as a 'Classic' alert in the portal. How should the template be changed so that the alert is added as a new alert but not as a classic alert?

推荐答案

类型"Microsoft.Insights/alertrules"是经典"指标,而

The type "Microsoft.Insights/alertrules" is the Classic metric and Classic alerts in Azure Monitor to retire in June 2019.

您可以使用的新模块为指标警报,其类型为"Microsoft.Insights/metricAlerts".请参阅模板中的指标警报,您将知道可以设置的所有属性.

You can use the new module is metric alert with the type "Microsoft.Insights/metricAlerts". See Metric Alert in the template and you will know all the properties that you can set.

有关旧警报和新警报之间的区别的更多详细信息,请参见

For more details about the difference between Old Alert and New Alert, see Old and New alerting capabilities.

这篇关于使用ARM模板的应用程序见解警报的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆