Override a parameter in the parameters.json file with PowerShell when deploying ARM template

Question:

I am using Azure PowerShell to deploy an ARM templates but want to override a parameter in the parameters.json file at runtime

Is there a way to do this?

eg I use get-azurermresource to get the virtual network name into a variable called $vnetName
I then want to pass this variable $vnetName to replace the parameters for Vnet Name in the azuredeploy.parameters.json file

Answer:

To overwrite the paramter at runtime you can just specify it when invoking the New-AzureRmResourceGroupDeployment cmdlet:


You could also permanently overwrite the json file itself using PowerShell:

Source:

Override a parameter in the parameters.json file with PowerShell when deploying ARM template by licensed under CC BY-SA | With most appropriate answer!

Leave a Reply