指标警报ARM模板部署— InternalServerError [英] Metric Alert ARM Template deployment — InternalServerError

查看:71
本文介绍了指标警报ARM模板部署— InternalServerError的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试使用下一个模板在Web测试下创建指标警报:

I've tried to create Metric Alert under Web Test, using next template:

{
  "$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
  "contentVersion": "1.0.0.0",
  "parameters": { "appName": {
        "type": "string",
        "metadata": {
          "description": "The name of the app insights instance."
        }
      },
      "WebTestName":
      {
        "type": "string",
        "defaultValue": "MyWebTest",
        "metadata": {
            "description": "The name of the Web Test instance"
        }
      },"rulesCount":
      {
          "type": "int",
          "defaultValue": 2,
          "minValue": 1,
          "maxValue": 99,
          "metadata": {
              "description": "Number of metric alerts to be created under webtest. Metric alerts are created under single webtest to simplify management"
          }

      }},
  "resources": [{
            "name": "[concat(parameters('appName'), '-', parameters('WebTestName'),'-WebTest', copyIndex() )]",
            "type": "Microsoft.Insights/metricAlerts",
            "apiVersion": "2018-03-01",
            "location": "global",
            "tags": {
				"[concat('hidden-link:', resourceId('microsoft.insights/components', parameters('appName') ) )]": "Resource",
				"[concat('hidden-link:', resourceId('microsoft.insights/webtests', concat(toLower(parameters('WebTestName')), '-', toLower(parameters('appName')) )))]": "Resource"
            },
            "properties": {
                "description": "",
                "enabled":true,
                "evaluationFrequency": "PT1M",
                "severity": 3,
                "windowSize": "PT5M",
                "actions":[
                ],
                "criteria":{
                    "odata.type": "Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria",
                    "webTestId": "[concat(toLower(parameters('WebTestName')), '-', toLower(parameters('appName')))]",
                    "componentId": "[resourceId('microsoft.insights/components', parameters('appName'))]",
                    "failedLocationCount": 1
                }
            },
            "copy": {
                "name": "createAlerts",
                "count": "[parameters('rulesCount')]"
              }
        }
        ]
}


并收到带有消息"InternalServerError"的


And got InternalServerError with message "

服务器遇到内部错误,请重试.如果问题仍然存在,请与支持人员联系."

The server encountered an internal error, please retry. If the problem persists, contact support".

我已经尝试了两次部署,但结果均相同.

I've tried deployment twice, both with same result.

问题:
1)我可以在一个Web测试中创建多个具有不同条件的度量标准警报或经典警报规则,不是吗?

Questions:
1) I am able to create multiple Metric Alerts or Classic Alert Rules all with different conditions under a single Web Test, am I not?

2)模板有问题吗?

2) Is something wrong with the template? Do I have to specify something more? 

推荐答案

查看我们的文档以

Looking at our documentation to Create a metric alert with a Resource Manager template, I would start with the template that is included there.  There also may be some confusion about the three kinds of alerts in Application Insights:

  • Metric alerts (which also includes classic alerts)
  • Web tests
  • Proactive diagnostics

我将查看"Web测试和指标警报"部分.

I would review the Web tests and Metric alerts section.


这篇关于指标警报ARM模板部署— InternalServerError的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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