Azure-quickstart-templates: [101-vm-from-user-image] Error "template parameters 'userImageStorageAccountName, userImageStorageAccountResourceGroupName' in the parameters file are not valid ... they are not present in the original template and can therefore not be provided at deployment time"

Created on 13 Jun 2017  路  3Comments  路  Source: Azure/azure-quickstart-templates

####[101-vm-from-user-image] (https://github.com/Azure/azure-quickstart-templates/tree/master/101-vm-from-user-image)

Issue Details

The parameters userImageStorageAccountName and userImageStorageAccountResourceGroupName are in the template parameters file but not the template file, so if you don't specify them, it fails like this:

New-AzureRmResourceGroupDeployment -resourceGroupName 'clwestus2' -TemplateParameterUri 'https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/101-vm-from-user-image/azuredeploy.parameters.json' -TemplateUri 'https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/101-vm-from-user-image/azuredeploy.json' -customVmName 'CL2008R2VM1' -adminUsername 'craig' -adminPassword $passwordSecureString -osDiskVhdUri 'https://clwestus2.blob.core.windows.net/vhds/GeneralizedUnpatched2008R2SP1.vhd' -dnsLabelPrefix 'CL2008R2VM1' -osType 'Windows' -vmSize 'Standard_A1_v2' -newOrExistingVnet 'existing' -newOrExistingVnetName 'clwestus2-vnet' -newOrExistingSubnetName 'default' -existingVnetResourceGroupName 'clwestus2'

New-AzureRmResourceGroupDeployment : 3:58:01 PM - Error: Code=InvalidTemplate; Message=Deployment template validation failed: 'The template parameters 'userImageStorageAccountName, userImageStorageAccountResourceGroupName' in the parameters file are not valid; they are not present in the original template and can therefore not be provided at deployment time. The only supported parameters for this template are 'customVmName, bootDiagnosticsStorageAccountName, bootDiagnosticsStorageAccountResourceGroupName, osDiskVhdUri, dnsLabelPrefix, adminUsername, adminPassword, osType, vmSize, newOrExistingVnet, newOrExistingVnetName, newOrExistingSubnetName, existingVnetResourceGroupName'. Please see https://aka.ms/arm-deploy/#parameter-file for usage details.'.
At line:1 char:1

  • New-AzureRmResourceGroupDeployment -resourceGroupName 'clwestus2' -Te ...
  • ~~~~~~~~~~~~~~~~~

    • CategoryInfo : NotSpecified: (:) [New-AzureRmResourceGroupDeployment], Exception

    • FullyQualifiedErrorId : Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation.NewAzureResourceGroupDeploymentCmdlet

New-AzureRmResourceGroupDeployment : The deployment validation failed
At line:1 char:1

  • New-AzureRmResourceGroupDeployment -resourceGroupName 'clwestus2' -Te ...
  • ~~~~~~~~~~~~~~~~~

    • CategoryInfo : CloseError: (:) [New-AzureRmResourceGroupDeployment], InvalidOperationException

    • FullyQualifiedErrorId : Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation.NewAzureResourceGroupDeploymentCmdlet template parameters 'userImageStorageAccountName, userImageStorageAccountResourceGroupName' in the parameters file are not valid ... they are not present in the original template and can therefore not be provided at deployment time

If you DO specify them it fails like this:

New-AzureRmResourceGroupDeployment -resourceGroupName 'clwestus2' -TemplateParameterUri 'https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/101-vm-from-user-image/azuredeploy.parameters.json' -TemplateUri 'https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/101-vm-from-user-image/azuredeploy.json' -customVmName 'CL2008R2VM1' -userImageStorageAccountName 'clwestus2' -userImageStorageAccountResourceGroupName 'clwestus2' -adminUsername 'craig' -adminPassword $passwordSecureString -osDiskVhdUri 'https://clwestus2.blob.core.windows.net/vhds/GeneralizedUnpatched2008R2SP1.vhd' -dnsLabelPrefix 'CL2008R2VM1' -osType 'Windows' -vmSize 'Standard_A1_v2' -newOrExistingVnet 'existing' -newOrExistingVnetName 'clwestus2-vnet' -newOrExistingSubnetName 'default' -existingVnetResourceGroupName 'clwestus2'

New-AzureRmResourceGroupDeployment : A parameter cannot be found that matches parameter name 'userImageStorageAccountName'.
At line:1 char:373

  • ... son' -customVmName 'CL2008R2VM1' -userImageStorageAccountName 'clwest ...
  • ~~~~~~~~

    • CategoryInfo : InvalidArgument: (:) [New-AzureRmResourceGroupDeployment], ParameterBindingException

    • FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation.NewAzureResourceGroupDeploymentCmdlet

Most helpful comment

So weird. I want one parameter file for all templates. In this case, how I do the refactor?

All 3 comments

@craiglandis as a quick workaround, delete userImageStorageAccountName and userImageStorageAccountResourceGroupName parameters from the azuredeploy.parameters.json file (Line# 8 - 13) and give a try. I checked the azuredeploy.json file and the above parameters are not used.

Anybody else think this is odd? Why not just skip passed the unused parameters?

So weird. I want one parameter file for all templates. In this case, how I do the refactor?

Was this page helpful?
0 / 5 - 0 ratings