nietras
nietras

Reputation: 4048

Azure Pipeline: Queue time Agent pool selection for yaml based pipeline

Trying to convert a "visually" defined Azure Pipeline to yaml, but have encountered a problem. With the "visually" defined Azure Pipeline you get a UI similar to below when doing a manual queue:

queue UI for visual pipeline

Note how this UI lets us select between agent pools at queue time. This is a functionality we use quite a lot. We do this since we have pipelines we use for machine learning for example.

Unfortunately, you cannot select Agent pool when switching to yaml based pipeline. It is simply gone, despite the yaml pipeline not defining the pool or similar.

queue UI for yaml pipeline

Is there any way for getting the same kind of dropdown box for the Agent pool for yaml based pipelines?

UPDATE: Using a variable for the pool name is possible but also a hassle so not looking for a solution that requires entering the full pool name upon queueing. Hence, either a dropdown box or some other mechanism.

Upvotes: 5

Views: 1477

Answers (3)

cdzar
cdzar

Reputation: 504

This is possible as of Feb 2020. Check out the new Runtime Parameters.

Selecting agent pools from a dropdown is actually their very first example.

parameters:
- name: image
  displayName: Pool Image
  type: string
  default: ubuntu-latest
  values:
  - windows-latest
  - vs2017-win2016
  - ubuntu-latest
  - ubuntu-16.04
  - macOS-latest
  - macOS-10.14

Upvotes: 3

Shayki Abramczyk
Shayki Abramczyk

Reputation: 41675

You can use a variable for the pool:

pool:
  vmImage: '$(pool)'

enter image description here

Then, in the yaml editor click on the top right ... and "Variables":

enter image description here

There define the pool variable with "Settable at queue time":

enter image description here

Now when you run the pipeline you can change the variable to what you want:

enter image description here

Upvotes: 3

4c74356b41
4c74356b41

Reputation: 72191

yeah, i dont think its possible to do that with yaml based pipelines, at least not according to the schema.

Upvotes: 0

Related Questions