Search code examples
azure-devopsazure-pipelinesazure-pipelines-yaml

How to specify the timeout for serverless pool in Azure DevOps deployment job strategy step


I have a deployment job which runs on a self hosted agent, using the runOnce strategy. In the postRouteTraffic I want to use the ManualValidation@0 task, but that must run on an agentless server. But that does not respect thet timeoutInMinutes set on the top level and is just the default of 60 min. You can specify a separate pool at each strategy step, but can't set the timeoutInMinutes, that seems to me as an omission.

jobs:
- deployment: DeployCloud
  displayName: Deploy cloud
  pool: MyPoolSelfHosted
  workspace:
    clean: all
  environment: TestCloud
  timeoutInMinutes: 12960 # 9 days
  strategy:
    runOnce:
      deploy:
        steps:
          ...
      routeTraffic:
        steps:
          ...
      postRouteTraffic:
        pool: server
        steps:
          - task: ManualValidation@0
            timeoutInMinutes: 11520 # 8 days
            inputs:
              notifyUsers: '[email protected]' 
              instructions: '..........' 
              onTimeout: 'reject'
      on:
        success:
          steps:
            ...

With above setup, the postRouteTraffic job just timeouts after the default 60 minutes. How to solve?


Solution

  • Currently, we cannot set timeoutInMinutes for each deployment lifecycle hook, no matter it is an agent or agentless job. Thus, the default 60-minute timeout for agentless jobs has limited the job execution time.

    Still, I can't agree more that this limiation is not a good design. For this, you may consider creating a feature request via Developer Community (visualstudio.com). That will allow you to directly interact with the appropriate Product Group, and make it more convenient for the product group to collect and categorize your suggestions.

    Hope the information helps.