Get-AzureRmAlertRule has breaking changes
Get-AzureRmAlertRule
PowerShell Version
5.1.16299.19
Module Version
4.0.0
OS Version
10.0.16299.19
Description
The Get-AzureRmAlertRule cmdlet a few days ago returned output in a particular format, which has now been changed from the Nov 8, 2017 update. Due to this, the engine we are using broke and we now have to adhere to the new output. I assume if there are breaking changes, its informed atleast an year in advance.
Debug Output
The output for the Get-AzureRmAlertRule a few days ago was in this format:
Properties : Name: : CF_webapp_Http4xx Condition : DataSource : MetricName : Http4xx ResourceId : /subscriptions/[subscriptionis]/resourceGroups/[resourcegroup]/providers/Microsoft.Web/sites/webapp Operator : GreaterThan Threshold : 100 Aggregation operator: Total Window size : 00:05:00 Description : This metric alert rule was created from Powershell version: 3.4.0 Status : Disabled Actions : SendToServiceOwners : False E-mails : [email protected] SendToServiceOwners : False E-mails : [email protected] Tags : hidden-link:/subscriptions/[subscriptionid]/resourceGroups/[resourceroup]/providers/Microsoft.Web/sites/webapp: Resource Id : /subscriptions/[subscriptionid]/resourceGroups/[resourcegroup]/providers/microsoft.insights/alertrules/CF_webapp_Http4xx Location : westus Name : CF_webapp_Http4xx
But, now after the update on Nov 8, 2017, I'm seeing the output in the following format:
AlertRuleResourceName : CF_webapp_Http4xx Description : This metric alert rule was created from Powershell version: 3.4.0 IsEnabled : False Condition : Microsoft.Azure.Management.Monitor.Management.Models.ThresholdRuleCondition Actions : {Microsoft.Azure.Management.Monitor.Management.Models.RuleEmailAction, Microsoft.Azure.Management.Monitor.Management.Models.RuleEmailAction} LastUpdatedTime : 10/27/2017 2:24:51 PM Id : /subscriptions/[subscriptionid]/resourceGroups/[resourcegroup]/providers/microsoft.insights/al ertrules/CF_webapp_Http4xx Name : CF_webapp_Http4xx Type : Microsoft.Insights/alertRules Location : westus Tags : {[hidden-link:/subscriptions/[subscriptionid]/resourceGroups/[resourcegroup]/providers/Microso ft.Web/sites/webapp, Resource]}
Script/Steps for Reproduction
Get-AzureRmAlertRule with the update prior to Nov 8 and with the Nov 8 update.
@vinaydam the November release contained breaking changes (and only breaking changes that were previously announced through warnings, obsolete attributes, and/or the upcoming-breaking-changes.md file found in each service's documentation folder). The full list of breaking changes can be found at https://aka.ms/azps-migration-guide
In the November release, @gucalder documented a breaking change to the Get-AzureRmAlertRule cmdlet with the flattening behavior you are seeing above, and it appears that a warning about this change had been active in the cmdlet since April.
We have breaking change releases twice a year, ensuring that customers are aware of the changes in some way ~6 months in advance.