AzureDevops - YAML pipeline - each expression with variable group

Viewed 47

Trying to use an each expression with a variable group. In the variable group, I've define a variable with multiple values. In the variable group "vg.test" - I have the variable "environments": dev, qa, uat, prod

Trying to run a set of commands for all environments defined in the variable with each expression.

YAML file:


variables:
- group: vg.test

jobs:
  - ${{ each env in $(environments) }}:
    - job:
      displayName: 
      steps:
      - template: 
        parameters:
          server_name: 
          user_name: 
          password: 
          cleanup_period: 

-- Pipeline Error --

while parsing pipeline YAML: Unrecognized value: '$'. Located at position within expression: $(environments).

If I use each expression with parameters.environmments (as long as I define environemnts as parameter) - the pipeline is running properly.

0 Answers
Related