target.settableVariables definition
Variables that can be set by a step.
Properties that use this definition: target.settableVariables
Properties that use this definition: target.settableVariables
Overloads
| Overload | Description |
|---|---|
| settableVariables: none | Disable a step from setting any variables. |
| settableVariables: string list | Restrict variable setting to a list of allowed variables. |
| Overload | Description |
|---|---|
| settableVariables: none | Disable a step from setting any variables. |
| settableVariables: string list | Restrict variable setting to a list of allowed variables. |
Remarks
You can disable setting all variables for a step, or restrict the settable variables to a list. If the settableVariables property is not set, the default allows all variables to be set by a step.
settableVariables: none
Disable a step from setting any variables.
settableVariables: none # Disable a step from setting any variables.
Properties
variableRestrictions
string
Acceptable values: nonesettableVariables: none # Disable a step from setting any variables.
Properties
variableRestrictions
string
Acceptable values: noneExamples
steps:
- script: echo This is a step
target:
settableVariables: none
settableVariables: string list
Restrict a step from setting any variables not in the specified list.
settableVariables: [ string ] # Restrict variable setting to a list of allowed variables.
Properties
variableRestrictions
string
settableVariables: [ string ] # Restrict variable setting to a list of allowed variables.
Properties
variableRestrictions
string
Examples
In the following example, the bash step can only set the value of the sauce variable. When the pipeline runs, the secretSauce variable is not set, and a warning is displayed on the pipeline run page.
steps:
- bash: |
echo "##vso[task.setvariable variable=sauce;]crushed tomatoes"
echo "##vso[task.setvariable variable=secretSauce;]crushed tomatoes with garlic"
target:
settableVariables:
- sauce
name: SetVars
- bash:
echo "Sauce is $(sauce)"
echo "secretSauce is $(secretSauce)"
name: OutputVars
See also
Feedback
Submit and view feedback for