Azure - 从其他资源组复制标签
Azure - Copy Tags from other Resource group
我需要在 Azure 中的资源组之间复制标签。
这可能吗?
有什么想法吗?
我会用一点 Powershell 说!
如果您还没有 AZ 模块,请先安装它 (link) or launch launch Cloud Shell in Azure portal
那么:
$sourceTags = (Get-AzResourceGroup -ResourceGroupName SOURCEGROUP).Tags
Set-AzResourceGroup -ResourceGroupName DESTINATIONGROUP -Tags $sourceTags
将 Get/Set-AzResourceGroup 替换为 AzResource 仅适用于任何其他资源类型。
我需要在 Azure 中的资源组之间复制标签。
这可能吗?
有什么想法吗?
我会用一点 Powershell 说!
如果您还没有 AZ 模块,请先安装它 (link) or launch launch Cloud Shell in Azure portal 那么:
$sourceTags = (Get-AzResourceGroup -ResourceGroupName SOURCEGROUP).Tags
Set-AzResourceGroup -ResourceGroupName DESTINATIONGROUP -Tags $sourceTags
将 Get/Set-AzResourceGroup 替换为 AzResource 仅适用于任何其他资源类型。