'Run Job in sequence in Azure Devops

stages:
- stage: A
     jobs:
     - job: A1
     pool: CloneX
     displayname: My Job A
     - job: A2
     pool: CloneX
     displayname: My Job B

This is my yaml for Azure Devops.

I noticed 2 Agents( as windows service) running on same Pool machine CloneX. Its an inhouse machine.

Job A1 and Job A2 MUST run in sequence.

However both A1 and A2 gets scheduled in parallel.

How to fix this issue?

By moving Job A2 to Stage B? OR

Keeping only 1 agent on pool CloneX?



Solution 1:[1]

You can specify job dependencies

jobs:
- job: Debug
  steps:
  - script: echo hello from the Debug build
- job: Release
  dependsOn: Debug
  steps:
  - script: echo hello from the Release build

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 silent