Azure / azure-powershell

Microsoft Azure PowerShell
Other
4.22k stars 3.82k forks source link

How to pass a value for the 'name' parameter of an ARM template using New-AzResourceGroupDeployment #11564

Open sdg002 opened 4 years ago

sdg002 commented 4 years ago

Description of the new feature

Hi All, My ARM template generated from the portal has a parameter name

image

While deploying using New-AzResourceGroupDeployment, I am unable to pass a value using the -name switch. The switch -name is being used for the name of the deployment and not the name of the Azure resource that I am trying to created.

I am able to work around the issue by renaming the name to name1 in the template.json file. But, this is laborious.

What have I missed?

Thanks.

dingmeng-xue commented 4 years ago

My understanding is you need to use -TemplateParameterObject. Please try.

Specifies a hash table of template parameter names and values. For help with hash tables in Windows PowerShell, type Get-Help about_Hash_Tables. If a template has parameters, you must specify parameter values. Template parameters are dynamically added to the command when you specify a template.