0

I try to add some tags on the Windows Template with this parameters file of an ARM template. I've seen this post Arm template reference but I cant make it work.

The return value is this [parameters('imageVersionNumber')] instead of 21.10.1802.

    {
      "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#",
      "contentVersion": "1.0.0.0",
      "parameters": {
        "imageVersionNumber": {
            "value": "21.10.1802"
        },
        "imageTemplateTags":{
            "value": {
                "imagebuilderTemplate": "win7",
                "Environment": "Dev",
                "Owner": "Someone",
                "Description": "Some description",
                "userIdentity":"enabled",
                "version": "[parameters('imageVersionNumber')]"
          }
        }
      }
    }
Mamquam
  • 37
  • 6

1 Answers1

1

You need to define parameters like the following:

"parameters": {
 "imageVersionNumber": {
    "type": "string",
    "defaultValue": "21.10.1802",
    "metadata": {
      "description": "Image version number"
    }     
  }
}
Nadine Raiss
  • 591
  • 1
  • 4
  • 17
  • Two questions. 1: Why on the link I share on my question someone says we can do this like I wrote it. 2: With your solution I can use this variable like I wrote it in my question ? – Mamquam Oct 19 '21 at 16:39
  • And your solution is for the main file but me I talk about the parameters file that the main link too. – Mamquam Oct 19 '21 at 17:32
  • 1
    To better understand how to use parameters in a file, take a look at these two links: https://learn.microsoft.com/en-us/azure/azure-resource-manager/templates/parameters#use-parameter and https://learn.microsoft.com/en-us/azure/azure-resource-manager/templates/parameter-files – Nadine Raiss Oct 20 '21 at 08:38