Ad
Azure DevOps Conditional For Multiple Values
I have been following this Microsoft doc and created a release pipeline in YAML, all works fine.
I have a conditional step that works fine as well:
- ${{ if contains(parameters.environment, 'PROD') }}:
Now requirement changed a bit, and the same conditional step requires checking against multiple values.
Like if this contains PROD or UAT the true.
I have been reading differnt places and tried following without luck:
- ${{ or(if contains(parameters.environment, 'PROD'), if contains(parameters.environment, 'UAT')) }}:
- ${{ if contains(parameters.environment, 'PROD', 'UAT') }}:
Any idea if this is possible and how to solve it? much appreciated 😊
Ad
Answer
Take for example the below:
${{ if or( eq(parameters.environment, 'PROD'), eq(parameters.environment, 'UAT') ) }}:
expressions syntax:
Ad
source: stackoverflow.com
Related Questions
- → is it possible to generate a graph in Visual Studio Online to show coders' contributions?
- → How to hide team activity lines on Visual Studio 2015?
- → Protect Git branch in Visual Studio Team Services like in GitHub
- → Set default branch using REST API
- → Database integration tests in Visual Studio Online
- → Difference between Team Foundation Server and Team Services
- → The platform "android" does not appear to be a valid cordova platform. It is missing API.js. android not supported
- → git fetch tags on Visual studio online build agent
- → git filter branch fatal revision
- → VSTS REST pushes api returns 409
- → Lock branch and alert developers that I am checking-in
- → Azure DevOps - Pull Request Git "Next steps: Manually resolve these conflicts and push new changes to the source branch."
- → Unable to perform TFVC to GIT import on VSTS
Ad