Reputation: 4048
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:
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.
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
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
Reputation: 41675
You can use a variable for the pool:
pool:
vmImage: '$(pool)'
Then, in the yaml editor click on the top right ...
and "Variables":
There define the pool
variable with "Settable at queue time":
Now when you run the pipeline you can change the variable to what you want:
Upvotes: 3
Reputation: 72191
yeah, i dont think its possible to do that with yaml based pipelines, at least not according to the schema.
Upvotes: 0