2017-07-01 51 views
-1

我正在尝试创建一个ARM模板来向我的弹性池数据库添加警报度量。我在门户中手动完成了这一步,并使用从门户网站生成的ARM模板。ARM模板 - AlertRules - UnsupporedMetric

这里是ARM的模板:

{ 
    "type": "microsoft.insights/alertrules", 
    "name": "[parameters('alertrules_dtu_name')]", 
    "apiVersion": "2014-04-01", 
    "location": "westus", 
    "tags": { 
    "hidden-link:/subscriptions/xxx/resourceGroups/xxx/providers/Microsoft.Sql/servers/xxx/elasticPools/ElasticPool1": "Resource" 
    }, 
    "scale": null, 
    "properties": { 
    "name": "[parameters('alertrules_dtu_name')]", 
    "description": "", 
    "isEnabled": true, 
    "condition": { 
     "odata.type": "Microsoft.Azure.Management.Insights.Models.ThresholdRuleCondition", 
     "dataSource": { 
     "odata.type": "Microsoft.Azure.Management.Insights.Models.RuleMetricDataSource", 
     "resourceUri": "[concat(resourceId('Microsoft.Sql/servers', parameters('sqlServerName')), '/elasticPools/ElasticPool1')]", 
     "metricName": "[concat(parameters('alertrules_dtu_name'),'_consumption_percent')]" 
     }, 
     "threshold": 90, 
     "windowSize": "PT10M" 
    }, 
    "action": { 
     "odata.type": "Microsoft.Azure.Management.Insights.Models.RuleEmailAction", 
     "customEmails": [ 
     "[email protected]" 
     ] 
    } 
    } 
} 

以下是错误消息部署此,当我得到:

新AzureRmResourceGroupDeployment:下午4时36分15秒 - 资源microsoft.insights/alertrules的'DTUAlert'失败,消息为' '代码:“UnsupportedMetric”, “message”:“此资源不支持名称空间为''且名称为'DTUAlert_consumption_percent'的度量标准

任何想法我在做什么错在这里?我已经尝试手动创建模板,针对不同版本的API,等等...仍然得到相同的错误。

回答

0

度量标准名称看起来不正确。您可以尝试使用以下指标name = dtu_consumption_percent?

+0

非常感谢!我的部分愚蠢的错误! – CtrlDot