1

I have Azure DevOps pipeline and I want to run it nightly run with two different agent pool, one dev and one prod.

This is the pipeline with default dev agent pool:

dev

In the schedule setting there is no option to set different agent pool to the runs:

schedule

I saw this answer (solution with yaml settings), but I didn't found a way to use it in my pipeline (my pipeline defined in Azure DevOps UI settings).

lior.i
  • 573
  • 1
  • 7
  • 20
  • You can't run a pipeline job on the same stage for separate agents. You can do different agent jobs within the same stage, but not the same jobs. You'll need to create a separate stage. – joelforsyth Apr 04 '22 at 21:10
  • You could create a copy of the pipeline with a new schedule and a different agent pool – GeralexGR Apr 05 '22 at 07:12
  • Tanks @GeralexGR, this is my current simple solution, I don't like it because it forced me to maintenance two pipelines instead of one. – lior.i Apr 05 '22 at 09:08

2 Answers2

1

As you use GUI classic pipelines you could define two different jobs that will run on different agent pools. This way you could have a single pipeline that you will run depending on your schedule.

enter image description here

When using YAML syntax you could define different stages to accomplish the same result.

https://learn.microsoft.com/en-us/azure/devops/pipelines/process/stages?view=azure-devops&tabs=yaml

GeralexGR
  • 2,973
  • 6
  • 24
  • 33
0

Create a new Stage. The first stage's job will use one pool and the second stage will use a different pool. They can then be scheduled or triggered independently. You can also clone the first stage to save you the time of duplicating the tasks.

Reference

joelforsyth
  • 836
  • 1
  • 11
  • 28
  • Thanks @joe, but looks like your solution is relevant to release pipeline. – lior.i Apr 05 '22 at 09:05
  • @lior.i you can also have stages on your build pipelines. The problem is that you cannot have different schedules for those stages and you should have the same. – GeralexGR Apr 05 '22 at 09:24
  • @GeralexGR, I have no problem with them be in the same time. I didn't saw a way to add stages to my build pipeline, just in the release pipeline. – lior.i Apr 05 '22 at 09:32
  • @lior.i do you have GUI pipelines for build or YAML ones? https://learn.microsoft.com/en-us/azure/devops/pipelines/process/stages?view=azure-devops&tabs=yaml – GeralexGR Apr 05 '22 at 09:54
  • @GeralexGR, I'm using UI pipelines, the link that you attached explains the release pipeline: ```You can organize the deployment jobs in your release pipeline into stages.``` – lior.i Apr 05 '22 at 10:21
  • @lior.i The link that I attached is for build pipelines. Release pipelines are only supported on GUI. When you see YAML syntax is refereed to build pipelines. – GeralexGR Apr 05 '22 at 10:23
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/243614/discussion-between-lior-i-and-geralexgr). – lior.i Apr 05 '22 at 10:28