YAML loop in Azure pipelines i want to assign concatinated values

Viewed 28

HI Azure pipeline i am getting struck and having error while doing this

parameters:

  - name: applications_module
    displayName: Applications
    type: boolean
    default: 'false'
    values: []
  - name: management_module
    displayName: Management
    type: boolean
    default: 'false'
    values: []
  - name: Creation
    displayName: Creation
    type: boolean
    default: 'false'
    values: []

variables:
- name: FilterValue 
    ${{each item in parameters}}:
      ${{if contains(item.name, '_module')}}: 
      value:  item.name # here I want to concatenate all the parameters names that have name _module but this statement is throwing an error 

I am not able to its saying "'value' is already defined" so can anyone help me regarding this

1 Answers

using ##VSO we can do that

   steps:
   - ${{ each parameter in parameters }}:
     - bash: echo '##vso[task.setvariable variable=allParametersString]$(allParametersString)${{ parameter.Key }}'
                   
  - script:
      echo 'concatenated strings by comma .->$(allParametersString)' 
Related