Share via


Azure-template: Parameters vs Variables

Question

Thursday, March 8, 2018 9:57 AM

Can someone explain why NetworkSecurityGroupName is a variable while VirtualVnetName is a parameter?

GH

All replies (5)

Sunday, March 11, 2018 8:00 PM ✅Answered | 1 vote

PARAMETERS: Values that are provided when deployment is executed to customize resource deployment.

VARIABLES: Values that are used as JSON fragments in the template to simplify template language expressions.

More information refer: Understand the structure and syntax of Azure Resource Manager templates.

Do click on "Mark as Answer" on the post that helps you, this can be beneficial to other community members.


Thursday, March 8, 2018 1:14 PM

Could you explain your query bit more to understand better? Is there any template or script which you are referring to?

Do click on "Mark as Answer" and “Vote as Helpful” on the post that helps you, this can be beneficial to other community members.


Thursday, March 8, 2018 2:15 PM

It's a generic question. In any VM deployment template there are Parameters and Variables. So when is it the one or the other? And how can it be that as in my example NetworkSecurityGroupName is a variable while VirtualVnetName is a parameter.

I'm following a MOC training and the templates comes from GitHub.

GH


Monday, March 12, 2018 9:52 AM

Any entry like that can be either, you could have a template with no parameters and all variable or the reverse.

It all depends on level of interaction required at deployment phase.

Joe


Tuesday, March 20, 2018 12:19 PM

PARAMETERS: Values that are provided when deployment is executed to customize resource deployment.

VARIABLES: Values that are used as JSON fragments in the template to simplify template language expressions.

More information refer: Understand the structure and syntax of Azure Resource Manager templates.

Do click on "Mark as Answer" on the post that helps you, this can be beneficial to other community members.

Okay. A good begin. I'll add:

Value is free to insert. Think about Password.

Variable is something you must choose. Think about a region. You can choose "West Europe". "South Europe" is not an option.

GH