How to Run Parallel Jobs in Azure Pipelines
Jobs without dependencies run in parallel automatically, bounded only by your parallel-jobs quota.
List multiple jobs in a stage with no dependsOn between them and they fan out. Use strategy.parallel to slice one job into N agents for sharded work.
Independent jobs and a sliced job
Lint and Test run in parallel; the Shard job runs 4 copies you split by index.
azure-pipelines.yml
jobs:
- job: Lint
steps: [{ script: npm run lint }]
- job: Test
steps: [{ script: npm run test:unit }]
- job: Shard
strategy:
parallel: 4
steps:
- script: npm test -- --shard=$(System.JobPositionInPhase)/$(System.TotalJobsInPhase)Gotchas
- Concurrency is capped by your purchased parallel jobs; excess jobs queue.
- With
strategy.parallel, useSystem.JobPositionInPhase/System.TotalJobsInPhaseto shard work yourself. - Parallel jobs each get a fresh agent - share results via pipeline artifacts, not the filesystem.
Related guides
How to Use a Matrix Strategy in Azure PipelinesFan a job out across versions or configurations in Azure Pipelines with strategy.matrix, named legs, maxParal…
How to Set Output Variables Between Jobs in Azure PipelinesPass a value from one Azure Pipelines job to another with an isOutput logging command and dependencies.<job>.…