azurecontinuous-integrationcicdpacker

How to pass azure tags to Packer CLI?


I need to pass azure tags to resources created by packer.

Documentation says that I need to use the azure_tags parameter, but its not very clear with the actual structure of the value.

The command

packer build -var azure_tags=Tag1,"value1",Tag2,"value2"

didn't work


Solution

  • You need to pass the values like this

    packer build -var "azure_tags={Tag1=\"Value1\", Tag2=\"Value2\"}"