Add-AzureRmAccount或者别名Login-AzureRmAccount似乎没有在会话之间持续存在Add-AzureAccount.
有没有办法让它坚持下去?
我得到一个Azure资源组并尝试添加类型为CPUPercentage的度量标准警报规则,但它失败并带有BadRequest.
> $r = Get-AzureRmResourcegroup
WARNING: The output object of this cmdlet will be modified in a future release.
> $a = $r[0]
> Add-AlertRule -Location "West US" -MetricName CpuPercentage -Name CPU98Percent -Operator GreaterThanOrEqual -ResourceGroup $a.ResourceGroupName -ResourceId $a.ResourceId -RuleType Metric -Threshold 98
Add-AlertRule : BadRequest:
At line:1 char:1
+ add-alertrule -Location "West US" -metricName CpuPercentage -Name CPU ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Add-AlertRule], CloudException
+ FullyQualifiedErrorId : Hyak.Common.CloudException,Microsoft.Azure.Commands.Insights.Alerts.AddAlertRuleCommand
Run Code Online (Sandbox Code Playgroud)
它从门户网站正常工作.还没有具有相同名称的警报.我正在使用Azure模块的第1版和AzureRM的1.0.2版.