Azure / azure-powershell

Microsoft Azure PowerShell
Other
4.26k stars 3.86k forks source link

Add-AzureRmMetricAlertRule Generic types are not supported for input fields at this time. #6462

Closed dennis-yemelyanov closed 6 years ago

dennis-yemelyanov commented 6 years ago

Any call to Add-AzureRmMetricAlertRule fails with "Generic types are not supported for input fields at this time.". There is no debug information available when passing -Debug and setting $DebugPreference = "Continue".

I'm using AzureRM 6.2.1/

praries880 commented 6 years ago

@dennis-yemelyanov Can you provide us the exact command you ran? I tried to create a rule against a resource in a subscription I have access to and was able to create it...

PS D:\Pary\PSModuleTests> Add-AzureRMMetricAlertRule -Name "metricRule5" -Location "West US 2" -ResourceGroup "<redacted>" -Operator GreaterThan -Threshold 2 -WindowSize 00:05:00 -MetricName "Percentage CPU" -Description "Pura Vid
a" -TimeAggregationOperator Total -TargetResourceId /subscriptions/<redacted>/resourceGroups/<redacted>/providers/Microsoft.Compute/virtualMachines/<redacted>
AlertRule                                                              RequestId                            StatusCode
---------                                                              ---------                            ----------
Microsoft.Azure.Management.Monitor.Management.Models.AlertRuleResource 8f49e084-cf08-496a-8c07-9b42ddd59294    Created

PS D:\Pary\PSModuleTests> Get-AzureRmAlertRule -ResourceGroupName <redacted>
WARNING: [Get-AzureRmAlertRule] Parameter deprecation: The DetailedOutput parameter will be deprecated in a future breaking change release.

AlertRuleResourceName : metricRule5
Description           : Pura Vida
IsEnabled             : True
Condition             : Microsoft.Azure.Management.Monitor.Management.Models.ThresholdRuleCondition
Actions               : {}
LastUpdatedTime       : 6/14/2018 6:33:21 PM
Id                    : /subscriptions/<redacted>/resourceGroups/<redacted>/providers/microsoft.insights/alertrules/metricRule5
Name                  : metricRule5
Type                  : Microsoft.Insights/alertRules
Location              : West US 2
Tags                  : {[hidden-link:/subscriptions/<redacted>/resourceGroups/<redacted>/providers/Microsoft.Compute/virtualMachines/<redacted>, Resource]}

PS D:\Pary\PSModuleTests> Remove-AzureRmAlertRule -ResourceGroupName <redacted> -Name metricRule5

RequestId                            StatusCode
---------                            ----------
7c76ebbe-a55e-4161-a264-7625d8871863         OK

Kindly paste the complete optput of gmo -ListAvailable as well as the command you run and its output (do redact personal information).

cormacpayne commented 6 years ago

@dennis-yemelyanov ping on the requested information above 😀

dennis-yemelyanov commented 6 years ago

I tried again, but can't repro anymore... Sometimes I run into weird issues when using "PoweShell Integrated Console" instead of just "powershell" in VS code, anyway I guess it was specific to my system. image