La creación de alertas para AppInsights falla con "Código": "ResourceNotSupported"

Creé un App Insights en la región central de EE. UU. Con este script:

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

Ahora estoy tratando de agregar una alerta a esta instancia de App Insights usando el siguiente script:

$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

Y siempre obtengo el siguiente error:

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.

¿Cómo puedo solucionar este problema?

Respuestas a la pregunta(2)

Su respuesta a la pregunta