首页 > 解决方案 > Azure Depolyment 的 Azure 标记不起作用

问题描述

我正在尝试使用 Tag 参数创建一个 Azure 部署,以使用命令 New-AzResourceGroupDeployment将标签放在部署上,例如 -

 New-AzResourceGroupDeployment -ResourceGroupName "demo" -TemplateFile "D:\Templates\storage.json" -Tag @{"CreatedFrom"="PS"; "Env"="Dev";}

但面对这个问题 -

New-AzResourceGroupDeployment : A parameter cannot be found that matches parameter name 'Tag'.
At line:1 char:102
+ ... Name "demo" -TemplateFile "D:\Templates\storage.json" -Tag @{"Crea ...
+                                                              ~~~~
    + CategoryInfo          : InvalidArgument: (:) [New-AzResourceGroupDeployment], ParameterBindingException
    + FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation.N
   ewAzureResourceGroupDeploymentCmdlet

根据文档,我们可以将标签参数与New-AzResourceGroupDeployment命令一起使用,但它对我不起作用。

对于我在这里做错的任何帮助将不胜感激!

在此处输入图像描述

标签: azurepowershellazure-resource-managerazure-deployment

解决方案


该命令在这里工作正常。确保您拥有最新版本的命令。

https://docs.microsoft.com/en-us/powershell/azure/new-azureps-module-az?view=azps-6.1.0


推荐阅读