Is there a way to set the allowed values of a parameter in Azure DevOps using some kind of a variable? For example, let’s say we have this parameter in 100 different pipelines:
I want to be able store the values array below somewhere global:
parameters:
- name: value
type: string
values: [value1, value2, value3, value4, value5, value6, value7]
The only way that have worked so far is a script that over-writes all the parameters with a specific name. For example:
- Scan all files for parameter with name “value”
- If found, over-write it with the updated values array.
However, this is far from ideal.
Here is what hasn’t worked:
Using Global Variables
variables:
- group: variable-group
parameters:
- name: value
type: string
values: [${{ variables.valueList }}]
Using Template
parameters:
template: values.yml
OR:
extend: values.yml
With values.yml:
parameters:
- name: value
type: string
values: [value1, value2, value3, value4, value5, value6, value7]
Anchors aren’t supported by ADO. Any other ideas?
LeonardALQ is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.