####[101-vm-from-user-image] (https://github.com/Azure/azure-quickstart-templates/tree/master/101-vm-from-user-image)
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 : The deployment validation failed
At line:1 char:1
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
@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?
Most helpful comment
So weird. I want one parameter file for all templates. In this case, how I do the refactor?