我正在尝试为功能警报创建一个天蓝色模板。
当我部署它时,我收到以下无用的错误:
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"
}
}
注意我没有包括实际的功能网站,因为它太长了,但如果它有帮助我可以