用于洞察警报的Azure ARM模板

时间:2017-08-29 16:14:49

标签: azure azure-template

我正在尝试为函数的警报创建一个azure模板。

当我部署它时,我得到以下无用的错误:

BadRequest: {
  "code": "InternalServerError",
  "message": "Exception of type 'Microsoft.WindowsAzure.Management.Monitoring.MonitoringServiceException' was thrown."
}

我可以手动创建提醒,并且我已经复制了模板语法,因此我不确定是什么问题。这是我的模板:

 {
      "comments": "Detect failing job",
      "type": "microsoft.insights/alertrules",
      "name": "scheduledeletejobfailing",
      "apiVersion": "2014-04-01",
      "location": "North Europe",
      "scale": null,
      "properties": {
        "name": "scheduledeletejobfailing",
        "description": "The scheduled job to delete cached files is failing",
        "isEnabled": true,
        "condition": {
          "odata.type": "Microsoft.Azure.Management.Insights.Models.ThresholdRuleCondition",
          "dataSource": {
            "odata.type": "Microsoft.Azure.Management.Insights.Models.RuleMetricDataSource",
            "resourceUri": "[resourceId('microsoft.insights/components', parameters('appname'))]",
            "metricNamespace": null,
            "metricName": "D1-ScheduledDeleteJobChecker Failures"
          },
          "operator": "GreaterThanOrEqual",
          "threshold": 1,
          "windowSize": "PT5M"
        },
        "action": {
          "odata.type": "Microsoft.Azure.Management.Insights.Models.RuleEmailAction",
          "sendToServiceOwners": false,
          "customEmails": [
            "address@addy.com"
          ]
        }
      },
      "dependsOn": [
        "[resourceId('microsoft.insights/components', parameters('appname'))]",
        "[resourceId('Microsoft.Web/sites',variables('functionHostingPlanName'))]"
      ]
    },
    {
      "apiVersion": "2014-04-01",
      "name": "[parameters('appName')]",
      "type": "microsoft.insights/components",
      "location": "North Europe",
      "tags": {
        "[concat('hidden-link:', resourceGroup().id, '/providers/Microsoft.Web/sites/', parameters('appName'))]": "Resource"
      },
      "properties": {
        "ApplicationId": "[parameters('appName')]",
        "Request_Source": "IbizaWebAppExtensionCreate"
      }
    }

注意我还没有包含实际的功能网站,因为它太长了,但我可以帮助

0 个答案:

没有答案