2016-04-01 38 views
1

Bu komut dosyası kullanarak Orta ABD'nin bölgede bir App Insights'ı oluşturulan "ResourceNotSupported": Bu uygulama Insights örneğine Bir Uyarı eklemek çalışıyorum ŞimdiUyarı oluşturma "Kod" başarısız:

New-AzureRmResource -ResourceName $appInsightsName -ResourceGroupName $defaultRgName -Tag @{ Name = "AppInsightsApp"; Value = $appInsightsName} -ResourceType "Microsoft.Insights/Components" -Location $defaultLocation -PropertyObject @{"Type"="ASP.NET"} -Force 

kullanılarak aşağıdaki komut dosyası:

$appInsights = Get-AzureRmResource -ResourceName $appInsightsName -ResourceGroupName $defaultRgName -ResourceType "Microsoft.Insights/Components" -Verbose 

Add-AlertRule -Name "Exception Occured" -Description "Exception occured alert" -ResourceGroup $defaultRgName -ResourceId $appInsights.ResourceId -MetricName "Server Exceptions" -Operator GreaterThanOrEqual -Threshold 1 -WindowSize 00:05:00 -CustomEmails "[email protected]" -Location $defaultLocation -RuleType Metric -Verbose 

Ve hep şu hatayı alıyorum:

Add-AlertRule : ResourceNotSupported: The target resource id 
'/subscriptions/XXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXX/resourceGroups/RG-Dev-CentralUS/providers/Microsoft.Insights/components/testkktest-appinsights' is not supported. 

nasıl yapabilirim f Bu konu?

cevap

2

Uyarı kuralları yalnızca Doğu ABD'de oluşturulabilir gibi görünüyor. Azure Portal'da da aynısı - yeri seçemezsiniz, ancak tüm kurallar Doğu ABD'de oluşturulur.

deneyin Powershell komut Doğu ABD konumu kullanmaya:

$appInsights = Get-AzureRmResource -ResourceName $appInsightsName -ResourceGroupName $defaultRgName -ResourceType "Microsoft.Insights/Components" -Verbose 

Add-AlertRule -Name "Exception Occured" -Description "Exception occured alert" -ResourceGroup $defaultRgName -ResourceId $appInsights.ResourceId -MetricName "Server Exceptions" -Operator GreaterThanOrEqual -Threshold 1 -WindowSize 00:05:00 -CustomEmails "[email protected]" -Location "East US" -RuleType Metric -Verbose 
+1

hata mesajı dese daha bilgilendirici bir çok bir halt olacağı bu hedef kaynak kimliği foo desteklenmiyor" gibi bir şey ** yer**." Veya muhtemelen "Bu konumda * hedef * kaynak türü * çubuğu desteklenmez *." Bu cevap üzerinde tökezlemeden önce kaynak kimliğimin ve referansların neyin yanlış olduğunu anlamaya çalışan bir sürü zaman harcadım. – shoover

+0

Elbette katılıyorum! :başparmak havaya – Jaya