แก้ไข

แชร์ผ่าน


Deployment group jobs

Azure DevOps Services | Azure DevOps Server | Azure DevOps Server 2022

You can use deployment groups in classic pipelines to define groups of target servers for deployment. Tasks that you define in a deployment group job run on some or all of the target servers. The number of target servers depends on the arguments that you specify for the tasks and the job itself.

You can select specific sets of servers from a deployment group to receive the deployment by specifying the machine tags that you defined for each server in the deployment group. You can also specify the proportion of the target servers that the pipeline should deploy to at the same time. This action ensures that the app running on these servers can handle requests during the deployment.

If you're using a YAML pipeline, you should use environments with virtual machines instead.

Instructions for defining groups

Use the information on one of the following tabs, depending on which pipeline you use.

Note

Deployment group jobs are not supported in YAML. You can use virtual machine resources in environments to do a rolling deployment to virtual machines in YAML pipelines.

You can configure rolling deployments by specifying the keyword rolling: under the strategy: node of a deployment job.

strategy:
  rolling:
    maxParallel: [ number or percentage as x% ]
    preDeploy:        
      steps:
      - script: [ script | bash | pwsh | powershell | checkout | task | templateReference ]
    deploy:          
      steps:
      ...
    routeTraffic:         
      steps:
      ...        
    postRouteTraffic:          
      steps:
      ...
    on:
      failure:         
        steps:
        ...
      success:          
        steps:
        ...

YAML builds aren't available.

Timeouts

Use the job timeout to specify the timeout, in minutes, for your jobs. A zero value for this option means that the timeout is effectively infinite. By default, jobs run until they finish or fail.

You can also set the timeout for each task individually. For more information, see Task options. Jobs that target Microsoft-hosted agents have additional restrictions on how long they can run.