Я пытаюсь привязать microsoft.insights/alertrules
к Microsoft.Web/sites
во время развертывания ARM в Azure.
Ошибка: There is no target resource for this alert CPU default-app-name-plan-ins-westeurope-default-environment
Я создал ресурсы в шаблоне, используя «сценарий автоматизации» вручную созданных ресурсов в качестве образца.
Предупреждение:
{
"type": "microsoft.insights/alertrules",
"location": "[variables('location')]",
"apiVersion": "2016-03-01",
"name": "[concat('CPU ', variables('insightComponentName'))]",
"dependsOn": [ "[resourceId('microsoft.insights/components', variables('insightComponentName'))]" ],
"tags": "[parameters('tags')]",
"properties": {
"name": "[concat('CPU ', variables('insightComponentName'))]",
"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', variables('insightComponentName'))]",
"metricNamespace": null,
"metricName": "performanceCounter.percentage_processor_time_normalized.value"
},
"operator": "GreaterThan",
"threshold": 85,
"windowSize": "PT5M"
},
"action": {
"odata.type": "Microsoft.Azure.Management.Insights.Models.RuleEmailAction",
"sendToServiceOwners": false,
"customEmails": [
"[parameters('alertReceiver')]"
]
}
}
},
Стек, развернутый с New-AzureRmResourceGroupDeployment -Verbose -ResourceGroupName rg.test.ARM -TemplateFile azuredeploy.json -TemplateParameterFile azuredeploy.parameters.json -DeploymentDebugLogLevel All
Полный код здесь и параметры здесь
Что я делаю не так?