Conditionally including tasks or templates not supported, "The first property must be a task"
See original GitHub issueThe preceding link describes a way to conditionally include templates based on parameters.
#azure-pipeline.yml
parameters:
- name: experimentalTemplate
displayName: 'Use experimental build process?'
type: boolean
default: false
steps:
- ${{ if eq(parameters.experimentalTemplate, true) }}:
- template: experimental.yml
- ${{ if not(eq(parameters.experimentalTemplate, true)) }}:
- template: stable.yml
This extension does not see this as a valid template, resulting in error “The first property must be a task”.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:3
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Getting error as unexpected property, First property must me ...
There is a clear bug with the UI here: There is no error running this yaml pipeline, the first property is a template...
Read more >Azure YAML pipelines conditional insertion doesn't work
So, when we execute the pipeline, the conditional insertion ${{ if eq(variables['AppType'], 'WebJob') }} has already been evaluated, however, ...
Read more >Templates - Azure Pipelines
In this article. Parameters; Extend from a template; Extend from a template with resources; Use templateContext to pass properties to templates ...
Read more >Task definition parameters - Amazon ECS
A port can only be included in one port mapping per container. You cannot specify overlapping port ranges. The first port in the...
Read more >React interactivity: Editing, filtering, conditional rendering
A task should only render if it is included in the results of applying the selected filter. Before we map over the tasks...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This is the same as #187, so closing in favor of that one. It’s on the todo list of things to tackle!
@iTiamo I recommend using
True
/False
in yaml. Canonical values areTrue
/False
rather thantrue
/false
. It normally doesn’t matter, but it can crop up and the subtle capitalization difference may be hard to spot. It bit my team once; so we just useTrue
/False
everywhere now. Also with a Boolean parameter there is no need foreq(parameters.experimentalTemplate, true)
,parameters.experimentalTemplate
works well.