danielsollondon / azvmimagebuilder

Azure VM Image Builder
180 stars 153 forks source link

Tagging when submitting the deployment #94

Open tim-beer opened 3 years ago

tim-beer commented 3 years ago

In our Azure tenant we have a Global policy that resource groups must be tagged otherwise resource groups fails creation

I'm facing the issue of the Submit template from deployment stage of the WVD instructions you have, as it fails this policy.

So far I have tried to add in the command line as an example

New-AzResourceGroupDeployment -ResourceGroupName $imageResourceGroup -TemplateFile $templateFilePath -api-version "2020-02-14" -imageTemplateName $imageTemplateName -svclocation $location -tag @{

security = "yes"; automation = "hours=247" }

but this still fails

I also tried adding to the tags in the JSON that gets created both adding to the 2 default tags and also removing the default tags and just adding ours, this still fails.

If I deploy a normal resource group with these methods they work ok.