2
votes

I'm looking if I can specify a list of agents in Agent pool demands? In UI azure pipeline has only two options equals and exists. So, I tried adding two demands but pipeline takes only first demand

Pipeline UI

The same in yaml is as follows,

pool:
  name: AWS Pool
  demands:
  - Agent.Name -equals simLin02
  - Agent.Name -equals ubuAgent01

I would like to know if there is any logical way of specifying the list of agent machines in yaml like following or any other alternatives where I can pass a list of agent names(specific agent names because not all agents in the pool have desired capability) for the pipeline to choose from.

pool:
  name: AWS Pool
  demands:
  - Agent.Name -in (simLin02, ubuAgent01)
1
Not get your latest information, is the workaround helpful for you? Or if you have any concern, feel free to share it here.LoLance
I mean I know of adding the capability but the problem is I don't have access to creating capabilities, I only know of machines that I need to choose from. Anyway, thank you for confirming that I cant send a list of machines to choose from that helps me in moving forward.r0r0n0a

1 Answers

5
votes

Sorry but as I know Azure Devops doesn't support specifying the list of agent machines using the logical way above. Instead we can define user-defined capabilities if we want to pass a list of agents for the pipeline to choose from. See:

enter image description here

For example: If we define one custom capability called RunTest for agents simLin02 and ubuAgent01, then we can easily use something like this to choose the list which contains these two agents:

pool:
  name: Default
  demands: RunTest

Since only agents simLin02 and ubuAgent01 contain the RunTest capability, it will pick one of them to run the pipeline. It actually has same effect like - Agent.Name -in (simLin02, ubuAgent01) whose syntax is not supported.