【发布时间】:2023-04-03 17:13:01
【问题描述】:
最近我在 Azure 自动化帐户中更新了 Azure Powershell 模块,似乎使用新版本的 AzureRm.Resources 模块处理资源标签和资源组更改的方式。 以前这是我列出具有 AutoShutdownSchedule 标记名称的资源组的方式
(Get-AzureRmResourceGroup | where {$_.Tags.Name -contains "AutoShutdownSchedule"}
现在根据https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-group-using-tags我必须使用:
Find-AzureRmResourceGroup -Tag @{Name="AutoShutDownSchedule"}
但这不会返回任何东西。但是 Find-AzureRmResourceGroup 正在工作:
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}
任何建议我做错了什么?
【问题讨论】:
-
如果我的回答有助于解决您的问题,并且如果您感谢您的帮助,请将答案标记为可接受的答案。
标签: azure azure-powershell azure-resource-group