My current azure pipeline looks like following -
parameters:
- name: Deploy
type: Boolean
default: false
- name: Stages
type: string
values:
- Stg A
- Stg B
- Stg C
- Stg D
- Stg E
I was trying to add a condition in such a way that if user checks Deploy on running pipeline, it should dynamically show up only Stg A, Stg B as values for Stages. And if they uncheck Deploy, it should show Stg C, Stg D and Stg E.
I tried to add conditions in following way -
parameters:
- name: Deploy
type: Boolean
default: false
- name: Stages
type: string
${{ if eq(parameters['Deploy'], 'true' ) }}:
values:
- Stg A
- Stg B
${{ if ne(parameters['Deploy'], 'true' ) }}:
values:
- Stg C
- Stg D
- Stg E
However, the following conditional way worked for variables, but did not work for parameters. Is there any way to achieve this in Azure pipelines.