Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 909
nietras Avatar asked Jul 08 '19 09:07

nietras


People also ask

How do I specify agent pool in YAML?

For more information, see the YAML schema for pools. To choose a pool and agent in the classic editor, navigate to the pipeline settings, select the desired Agent pool, and then the desired image from the Agent Specification drop-down. The default Agent Specification is windows-2019.

What is pool in YAML pipeline?

In Azure DevOps Server 2019 you can specify a pool at the job level in YAML, and at the pipeline level in the pipeline settings UI. In Azure DevOps Server 2019.1 you can also specify a pool at the pipeline level in YAML if you have a single implicit job. You can specify a pool at the pipeline, stage, or job level.


1 Answers

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
like image 99
cdzar Avatar answered Sep 23 '22 21:09

cdzar