在Azure DevOps管道上,我有一个发布阶段任务,其中包括配置Azure警报,其中定义了一些规则。执行时出现以下错误:
Error: Failed to update Azure metric alert rule 'se' Resource. Error: BadRequest - {"code":"BadRequest","message":"Value cannot be null.\r\nParameter name: No definition for metric 'exceptions/server' for '/subscriptions/ID/resourceGroups/OurSfwWebApp/providers/Microsoft.Insights/components/OurSfwCom'","innererror":{"diagnosticcontext":"ID","time":"2019-07-18T04:36:22.7252407Z"}} (CODE: 400)
这是YAML中任务的实际定义:
步骤: -任务:AzureMonitorAlerts @ 0 displayName:'配置Azure警报:OurSfwCom' 输入: 订阅:OurSfw ResourceGroupName:OurSfwWebApp 资源名称:OurSfwCom AlertRules:'{“ resourceId”:“ / subscriptions / ID / resourceGroups / OurSfwWebApp / providers / microsoft.insights / components / OurSfwCom”,“ rules”:[{“ alertName”:“ se”,“ metric”:{“ value “:” exceptions / server“,” displayValue“:”服务器例外“,” unit“:” Count“},” thresholdCondition“:”>“,” thresholdValue“:” 5“,” timePeriod“:” 5分钟“},{” alertName“:” fr“,” metric“:{” value“:” requestFailed.count“,” displayValue“:”失败的请求“,” unit“:” Count“},” thresholdCondition“ :“>”,“ thresholdValue”:“ 10”,“ timePeriod”:“在最近5分钟内”“},{” alertName“:” srt“,” metric“:{” value“:” request.duration“, “ displayValue”:“服务器响应时间”,“ unit”:“ Seconds”},“ thresholdCondition”:“>”,“ thresholdValue”:“ 5”,“ timePeriod”:“最近5分钟”“},{” alertName“:” av“,” metric“:{” value“:” availabilityResults / availabilityPercentage“,” displayValue“:” Availability“,” unit“:” Percent“},” thresholdCondition“:” <“,” thresholdValue“ :“ 90”,“ timePeriod”:“过去5分钟内”“]}}' NotifyServiceOwners:错误
我做错了什么?