Skip to content
This repository has been archived by the owner on Jan 30, 2021. It is now read-only.

Deployment template validation failed while deploying machine in azure #149

Closed
christopher-hirudayasamy opened this issue Jan 10, 2017 · 1 comment

Comments

@christopher-hirudayasamy
Copy link
Contributor

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/214d050d-5430-4fd8-bb08-8152128a07b9/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: missing the adminpassword parameter after deployment

Parameter file:

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

@devigned
Copy link
Member

devigned commented Feb 2, 2017

Should be fixed. Please reopen if it's still an issue.

@devigned devigned closed this as completed Feb 2, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants