홈>
탄력적 풀 데이터베이스에 경고 메트릭을 추가하기 위해 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": [
"[email protected]"
]
}
}
}
배포 할 때 나타나는 오류 메시지는 다음과 같습니다.
New-AzureRmResourceGroupDeployment : 4:36:15 PM - Resource microsoft.insights/alertrules 'DTUAlert' failed with message '{ "code": "UnsupportedMetric", "message": "The metric with namespace '' and name 'DTUAlert_consumption_percent' is not supported for this resource
여기서 내가 뭘 잘못하고 있는지 알아? 다른 버전의 API 등을 대상으로 템플릿을 수동으로 만들려고 시도했지만 여전히 같은 오류가 발생합니다.
- 답변 # 1
메트릭 이름이 잘못 보입니다. 다음 측정 항목 이름 = dtu_consumption_percent로 시도해 볼 수 있습니까?