Dynamically include variable groups for each env
#build-stage.yml
stages:
- stage: Build
${{ if eq(parameters.enableVariableGroups, 'true') }}:
variables:
- ${{ each group in parameters.variableGroupNames }}:
- group: ${{ group }}
df
#main-pipeline.yml
stages:
- template: build-stage.yml@Templates
parameters:
environment: dev
variableGroupNames:
- "demo-variable-group"
- "another-demo-variable-group"