[英]Error adding Alert Rule to Azure Cloud Service
I've created a script to add alert rules to several Azure resources (web apps, SQL databases, and cloud services). 我已经创建了一个脚本来向几个Azure资源(Web应用程序,SQL数据库和云服务)添加警报规则。 Everything works except for creating the cloud service alerts which returns an error:
除了创建返回错误的云服务警报外,一切正常:
Add-AlertRule : ResourceProviderNotSupported: The resource provider 'Microsoft.ClassicCompute' is not supported.
Add-AlertRule:ResourceProviderNotSupported:不支持资源提供程序“Microsoft.ClassicCompute”。
This is the script I'm using to add the rule: 这是我用来添加规则的脚本:
$cloudServices = Get-AzureResource -ResourceType "Microsoft.ClassicCompute/domainNames" -ResourceGroupName $resourceGroup
Foreach ($cloudService in $cloudServices)
{
# Cloud Service - CPU Percentage
Add-AlertRule `
-RuleType Metric `
-Name "CPU Percentage (Cloud Service)" `
-Location $cloudService.Location `
-ResourceGroup $cloudService.ResourceGroupName `
-Operator GreaterThan `
-Threshold 75 `
-WindowSize 01:00:00 `
-ResourceId $cloudService.ResourceId `
-MetricName "Percentage CPU" `
-TimeAggregationOperator Average `
-SendToServiceOwners
}
I've tried other using a different ResourceType
parameter to target the role instead of the cloud service, but that doesn't work either. 我尝试过使用不同的
ResourceType
参数来定位角色而不是云服务,但这也不起作用。
Has anyone had any experience scripting these cloud service alerts successfully? 有没有人有成功编写这些云服务警报的经验?
Hi Garrett sometime back I had created same kind of stuff without any issues. 嗨加勒特回来的时候我创造了同样的东西没有任何问题。 Please have a look on this link-
请看看这个链接 -
http://blogs.technet.com/b/keithmayer/archive/2014/11/08/scripts-to-tools-automate-monitoring-alert-rules-in-microsoft-azure-with-powershell-and-the-azure-service-management-rest-api.aspx http://blogs.technet.com/b/keithmayer/archive/2014/11/08/scripts-to-tools-automate-monitoring-alert-rules-in-microsoft-azure-with-powershell-and-the- Azure的服务管理,休息,api.aspx
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.