我正在尝试创建一个 ARM 模板来向我的弹性池数据库添加警报指标。我已在门户中手动完成此操作,并且正在使用从门户生成的 ARM 模板。
这是 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": [
"xxx@xxx.com"
]
}
}
}
这是我在部署时收到的错误消息:
New-AzureRmResourceGroupDeployment:下午 4:36:15 - 资源 microsoft.insights/alertrules 'DTUAlert' 失败,消息为 '{ "code": "UnsupportedMetric", "message": "The metric with namespace '' and name 'DTUAlert_consumption_percent' is此资源不支持
知道我在这里做错了什么吗?我尝试手动创建模板,针对不同版本的 API 等...仍然得到相同的错误。