Limiting number of parallel jobs in Azure DevOps Pipeline

Viewed 674

I would like to limit the job to parallel - 10 . My total job is around 150. How can I define "strategy: parallel" in my below yaml structure. I have for each loop which creates more than 100 job. So taking more than 1 hrs to finish and also uses all agent. So want to limit the agent. Can someone help?

Code below:

stages:
- stage: xxx
  jobs:
      - ${{ each v in parameters.vvv }}:
        - template: Templates/aa.yml
          parameters:
1 Answers

Use a job with a parallel or matrix strategy, as explained in the documentation. You can set the maximum degree of parallelism.

jobs:
- job: string  # name of the job (A-Z, a-z, 0-9, and underscore)
  strategy:
    parallel: # parallel strategy; see the following "Parallel" topic
    matrix: # matrix strategy; see the following "Matrix" topic
    maxParallel: number # maximum number of matrix jobs to run simultaneously
Related