Visual Studio 2019 16.8.5
I want to use template for stages. Some stages, I'd like to be based on conditions. However, when I try this in the YML file, it generates errors. Here are two attempts in the azure-pipelines.yml file:
stages:
- template: 'build.yml'
- template: 'deploy.yml'
- template: 'test.yml'
- ${{ if eq('true', 'true') }}:
- template: 'optional.yml'
Results in:
Severity Code Description Project File Line Suppression State
Error Property ${{ if eq('true', 'true') }} is not allowed. azure-pipelines.yml 8
And this:
stages:
- template: 'build.yml'
- template: 'deploy.yml'
- template: 'test.yml'
- template: 'optional.yml'
condition: eq('true', 'true')
results in:
Severity Code Description Project File Line Suppression State
Error Property template is not allowed. azure-pipelines.yml 8
What is wrong with the above syntax and what is needed to achieve the requirement without errors?