2016-04-06 24 views
0

我無法從電源外殼創建警報Azure的Powershell的附加AlertRule不工作

命令

Add-AlertRule -Name "poor sales" -Description "slow sales alert" -ResourceGroup "Default-ApplicationInsights-CentralUS" -ResourceId "/subscriptions/subsId/resourcegroups/Default-ApplicationInsights-CentralUS/providers/microsoft.insights/components/TestAppIns" -MetricName "salesPerHour" -Operator LessThan -Threshold 100 -WindowSize 00:30:00 -CustomEmails "[email protected]","[email protected]" -Location "East US" -RuleType Metric 

異常詳細信息

Add-AlertRule : InternalServerError: Exception of type 'Microsoft.WindowsAzure.Management.Monitoring.MonitoringServiceException' was thrown. At line:1 char:1 + Add-AlertRule -Name "poor sales" -Description "slow sales alert" -ResourceGrou ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Add-AlertRule], CloudException + FullyQualifiedErrorId : Hyak.Common.CloudException,Microsoft.Azure.Commands.Insights.Alerts.AddAlertRuleCommand

回答

0

自定義指標的警報規則不能創建在度量標準寫入之前,零度值至少有一次爲。我不知道這是一個問題還是設計行爲。 它是由以下解決方法在我的案件告破:

  1. 創建應用程序洞察服務
  2. 部署雲/ Web服務並初始化所有指標
  3. 創建警報規則

我猜你應該聯繫MS支持,如果解決方法不適用於您的情況。