parameters.name definition
A parameter represents a value passed to a pipeline.
pipelineTemplateParameters:
- name: string # Required as first property. Parameter name..
displayName: string # Human-readable name for the parameter.
type: string # Parameter type. Required.. (boolean,deployment,deploymentList,environment,filePath,job,jobList,number,object,pool,secureFile,serviceConnection,stage,stageList,step,stepList,string)
default: any # Default value if none is specified.
values: [ string ] # Allowed parameter values.
Properties that use this definition: parameters.pipelineTemplateParameters
Properties
name
string
Required as first parameter. Parameter name.displayName
string
Human-readable name for the parameter.type
pipelineTemplateParameterType
Parameter type. Required.default
Depends on the type
Default value if none is specified.values
string list
Allowed parameter values.pipelineTemplateParameters:
- name: string # Required as first property. Parameter name..
displayName: string # Human-readable name for the parameter.
type: string # Parameter type. Required.. (boolean,container,containerList,deployment,deploymentList,environment,filePath,job,jobList,number,object,pool,secureFile,serviceConnection,stage,stageList,step,stepList,string)
default: any # Default value if none is specified.
values: [ string ] # Allowed parameter values.
Properties that use this definition: parameters.pipelineTemplateParameters
Properties
name
string
Required as first parameter. Parameter name.displayName
string
Human-readable name for the parameter.type
pipelineTemplateParameterType
Parameter type. Required.default
Depends on the type
Default value if none is specified.values
string list
Allowed parameter values.pipelineTemplateParameters:
- name: string # Required as first property. Parameter name..
displayName: string # Human-readable name for the parameter.
type: string # Parameter type. Required.. (boolean,container,containerList,deployment,deploymentList,environment,filePath,job,jobList,number,object,pool,secureFile,serviceConnection,stage,stageList,step,stepList,string)
default: any # Default value if none is specified.
values: [ string ] # Allowed parameter values.
Properties that use this definition: parameters.pipelineTemplateParameters
Properties
name
string
Required as first parameter. Parameter name.displayName
string
Human-readable name for the parameter.type
pipelineTemplateParameterType
Parameter type. Required.default
Depends on the type
Default value if none is specified.values
string list
Allowed parameter values.pipelineTemplateParameters:
- name: string # Required as first property. Parameter name..
displayName: string # Human-readable name for the parameter.
type: string # Parameter type. Required.. (boolean,container,containerList,deployment,deploymentList,environment,filePath,job,jobList,number,object,pool,secureFile,serviceConnection,stage,stageList,step,stepList,string)
default: any # Default value if none is specified.
values: [ string ] # Allowed parameter values.
Properties that use this definition: parameters.pipelineTemplateParameters
Properties
name
string
Required as first parameter. Parameter name.displayName
string
Human-readable name for the parameter.type
pipelineTemplateParameterType
Parameter type. Required.default
Depends on the type
Default value if none is specified.values
string list
Allowed parameter values.Remarks
The type and name fields are required when defining parameters. See all parameter data types.
parameters:
- name: string # name of the parameter; required
type: enum # see the enum data types in the following section
default: any # default value; if no default, then the parameter MUST be given by the user at runtime
values: [ string ] # allowed list of values (for some data types)
Types
The type value must be one of the enum members from the following table.
| Data type | Notes |
|---|---|
string |
string |
number |
may be restricted to values:, otherwise any number-like string is accepted |
boolean |
true or false |
object |
any YAML structure |
step |
a single step |
stepList |
sequence of steps |
job |
a single job |
jobList |
sequence of jobs |
deployment |
a single deployment job |
deploymentList |
sequence of deployment jobs |
stage |
a single stage |
stageList |
sequence of stages |
The step, stepList, job, jobList, deployment, deploymentList, stage, and stageList data types all use standard YAML schema format. This example includes string, number, boolean, object, step, and stepList.
parameters:
- name: myString
type: string
default: a string
- name: myMultiString
type: string
default: default
values:
- default
- ubuntu
- name: myNumber
type: number
default: 2
values:
- 1
- 2
- 4
- 8
- 16
- name: myBoolean
type: boolean
default: true
- name: myObject
type: object
default:
foo: FOO
bar: BAR
things:
- one
- two
- three
nested:
one: apple
two: pear
count: 3
- name: myStep
type: step
default:
script: echo my step
- name: mySteplist
type: stepList
default:
- script: echo step one
- script: echo step two
trigger: none
jobs:
- job: stepList
steps: ${{ parameters.mySteplist }}
- job: myStep
steps:
- ${{ parameters.myStep }}
Examples
# File: azure-pipelines.yml
parameters:
- name: image
displayName: Pool Image
type: string
default: ubuntu-latest
values:
- windows-latest
- ubuntu-latest
- macOS-latest
trigger: none
jobs:
- job: build
displayName: build
pool:
vmImage: ${{ parameters.image }}
steps:
- script: echo The image parameter is ${{ parameters.image }}```
You can use parameters to extend a template. In this example, the pipeline using the template supplies the values to fill into the template.
# File: simple-param.yml
parameters:
- name: yesNo # name of the parameter; required
type: boolean # data type of the parameter; required
default: false
steps:
- script: echo ${{ parameters.yesNo }}
# File: azure-pipelines.yml
trigger:
- main
extends:
template: simple-param.yml
parameters:
yesNo: false # set to a non-boolean value to have the build fail
See also
See templates for more about working with templates.
Feedback
Submit and view feedback for