0

Facing following issues while performing vagrant up with azure provider

"response": {
    "body": "{\"error\":{\"code\":\"InvalidTemplate\",\"message\":\"Deployment template validation failed: 'The value fo
r the template parameter 'adminPassword' at line '1' and column '306' is not provided. Please see https://aka.ms/arm-dep
loy/#parameter-file for usage details.'.\"}}",

Template file:

{
  "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
  "contentVersion": "1.0.0.0",
  "parameters": {
    "vaults_VaultVagrant_name": {
      "defaultValue": "VaultVagrant",
      "type": "String"
    },
    "AdminPassword":{
    "type":"securestring"
    }

  },
  "variables": {},
  "resources": [
    {
      "type": "Microsoft.KeyVault/vaults",
      "name": "[parameters('vaults_VaultVagrant_name')]",
      "apiVersion": "2015-06-01",
      "location": "eastus",
      "tags": {},
      "properties": {
        "sku": {
          "family": "A",
          "name": "standard"
        },
        "tenantId": "yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy",
        "accessPolicies": [
          {
            "tenantId": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
            "objectId": "1efb1891-8ad4-4f69-9e0d-f5849e6f8c98",
            "permissions": {
              "keys": [
                "get",
                "create",
                "delete",
                "list",
                "update",
                "import",
                "backup",
                "restore"
              ],
              "secrets": [
                "all"
              ]
            }
          }
        ],
        "enabledForDeployment": true
      },
      "resources": [],
      "dependsOn": []
    }

  ]
}

Parameter

{
  "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#",
    "contentVersion": "1.0.0.0",
    "parameters": {
        "AdminPassword": {
            "reference": {
               "keyVault": {
                  "id":"/subscriptions/xxxxxxxxxxxxxxxxxxxxxxxxx/resourceGroups/azurevag/providers/Microsoft.KeyVault/vaults/VaultVagrant"
               }, 
               "secretName": "vagrant" 
            }   
        }
   }
}

I am deploying both files from local machine as like in below

azure group deployment create -f "c:\MyTemplates\example.json" -e "c:\MyTemplates\example.params.json" -g examplegroup -n exampledeployment

ISSUE:after deployment is successfully created checked the deployment script in azure portal where both the files look like below

TemplateFile

{
  "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
  "contentVersion": "1.0.0.0",
  "parameters": {
    "vaults_VaultVagrant_name": {
      "defaultValue": "VaultVagrant",
      "type": "String"
    }
  },
  "variables": {},
  "resources": [
    {
      "comments": "Generalized from resource: '/subscriptions/xxxxxxxxxxxxxxxxxxxx/resourceGroups/azurevag/providers/Microsoft.KeyVault/vaults/VaultVagrant'.",
      "type": "Microsoft.KeyVault/vaults",
      "name": "[parameters('vaults_VaultVagrant_name')]",
      "apiVersion": "2015-06-01",
      "location": "eastus",
      "tags": {},
      "properties": {
        "sku": {
          "family": "A",
          "name": "standard"
        },
        "tenantId": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
        "accessPolicies": [
          {
            "tenantId": "yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy",
            "objectId": "1efb1891-8ad4-4f69-9e0d-f5849e6f8c98",
            "permissions": {
              "keys": [
                "get",
                "create",
                "delete",
                "list",
                "update",
                "import",
                "backup",
                "restore"
              ],
              "secrets": [
                "all"
              ]
            }
          }
        ],
        "enabledForDeployment": true
      },
      "resources": [],
      "dependsOn": []
    }
  ]
}

**Note:**Parameter adminpassword is missing after deployment

Parameter file:

parameter file is empty. How the values(admin password) are missed after deployment?

  • if possible, maybe you could share your template. – Shui shengbao Jan 6 '17 at 1:33
  • "AdminPassword": { "reference": { "keyVault": { "id":"/subscriptions/xxxxxxxxxxxxxxxxxxxxxxxxx/resourceGroups/azurevag/providers/Microsoft.KeyVault/vaults/VaultVagrant" }, is your AdminPassword? – Shui shengbao Jan 10 '17 at 2:04
  • @Walter-MSFT Yes.I have passed the secret value through key vault – Jeeva S Jan 10 '17 at 3:45
  • @JeevaS I'm a bit confused by your templates, by the looks of it your ARM template is creating a keyvault, but your paramater file is looking up a password from the same keyvault, this can't work as teh Keyvault doesn't exist at the time the param file is run, unless you have two keyvaults? – Sam Cogan Jan 10 '17 at 10:56
  • @Walter-MSFT Key vault is created manually and then secure key is set Valutname:VaultVagrant. couldn't find the mistake what i have done Could you suggest me the work around to fix this? – Jeeva S Jan 11 '17 at 10:46
0

The ARM template is expecting a parameter called AdminPassword which it's not received. Without seeing your template and parameters it's difficult to know why, but most templates expect parameters as a secure string, so make sure you are providing it in the right format.

| improve this answer | |
  • i have added both template files – Jeeva S Jan 10 '17 at 4:17
0

According to your error, maybe your template lost the parameter ‘adminPassword’ or had some grammar error in column ‘306’. Maybe you could check your template. I suggest you use tools to check your template. JSON Formatter and Validator maybe a good option.

enter image description here

| improve this answer | |
  • Validated the templates and I have added the template files. there is no grammatical error or syntax error in template files.kindly check the template and let me know if any issues? – Jeeva S Jan 20 '17 at 4:12
  • @JeevaS Yes,there is no grammatical error or syntax error. Do you try to deploy it by other ways? Maybe you could ask the question on Azure support forms. – Shui shengbao Jan 20 '17 at 4:57
  • @JeevaS Maybe you could try to this link to deploy vagrant github.com/Azure/vagrant-azure – Shui shengbao Jan 20 '17 at 5:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.