2
votes

I have set up a multi-agent job for an Azure Release Pipeline. There are two agents in the agent pool. The job needs to be executed by every agent in the agent pool.

Multi-agent job

The settings shown in the above schedule two agent jobs whenever a release is triggered. If both agents are idle while the deployment starts, everything works as expected and both agents execute the job. But, as soon as one agent is busy at that time the behavior becomes unexpected and both jobs are executed by the same agent consecutively.

Agent job 1 Agent job 2

How can I ensure that every agent of the agent pool is executing the defined agent job?

1
We're going to need more info. Which part of this is relevant to you? docs.microsoft.com/en-us/azure/devops/pipelines/licensing/…Train
I am using two self-hosted agents assigned to the same agent pool. How can I provide you more information that is relevant to the question? What exactly do you need to know?millo
Sorry I misunderstood the question. I misread as soon as one agent is busy at that time the behavior becomes unexpected and both jobs are executed by the same agent consecutively it makes more sense.Train
Each job consumes a parallel job that runs on an agent. When there aren't enough parallel jobs available, the jobs are queued up and run one after the other. That's why it uses the same agent. Enough agents need to be available at the time off execution or it's gonna queue it to the same agent.Train

1 Answers

0
votes

This is as designed. If one agent pool has two agents A and B, while A is busy, the build job will running with B. So in pool, if some agents are busy, the pipeline will running with other free and available agent.

The precondition of Parallel job is that you must has enough agents free and available. That's why as soon as one agent is busy at that time the behavior becomes unexpected.