Recently I update Azure Powershell modules in Azure Automation Account and it seems that with new version of AzureRm.Resources module the way of dealing with tags on resources and resource group changes. Previously this is how I would list resource groups with AutoShutdownSchedule tag name
(Get-AzureRmResourceGroup | where {$_.Tags.Name -contains "AutoShutdownSchedule"}
Now according to https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-group-using-tags I have to use:
Find-AzureRmResourceGroup -Tag @{Name="AutoShutDownSchedule"}
But this doesn't return anything. However Find-AzureRmResourceGroup is working:
Find-AzureRmResourceGroup
id : /subscriptions/xxxxx/resourceGroups/HaaS-CDH-Starter-Spotfire-1393
name : xxxxx
location : eastus2
tags : @{AutoShutdownSchedule=18:00}
properties : @{provisioningState=Succeeded}
id : /subscriptions/xxxxxx/resourceGroups/mnt-dev-us
name : xxxx
location : eastus2
tags : @{AutoShutdownSchedule=18:00}
properties : @{provisioningState=Succeeded}
Any suggestions what I'm doing wrong?