A Microsoft Foundry project's CI pipeline uses a reusable job template. The caller passes an agent-pool mapping to the template, and the template substitutes the complete mapping into the job's pool property. Both references shown in the exhibit must remain unchanged.
# Excerpt from azure-pipelines.yml
jobs:
- template: templates/project-check.yml
parameters:
executionPool:
vmImage: ubuntu-latest
# Excerpt from templates/project-check.yml
# Parameter declarations and job steps are omitted.
jobs:
- job: ProjectCheck
pool: ${{ parameters.executionPool }}
Which type should the template declare for executionPool?
Why
Declare executionPool as an object parameter. The caller provides a YAML mapping, and the template inserts that mapping directly into pool, following the documented object-parameter pattern.
- Correct:
object. The object-parameter example accepts a mapping containing vmImage and substitutes the parameter directly into a job's pool property, matching this template. - Not correct:
stepList. the documentation uses stepList for a parameter inserted into a job's steps. This parameter instead supplies the pool mapping, for which the documentation demonstrates object. - Not correct:
boolean. A Boolean parameter represents a true-or-false value, as shown by the conditional-test example. It does not represent the pool mapping supplied here. - Not correct:
string. The caller supplies a mapping rather than a scalar string. The documented pattern uses an object parameter to pass that mapping directly to the pool property.
Source