24

Is there a way to change the timeout for build pipeline, currently the pipeline time's out after 60 mintues. I want to reduce it to 30 minutes.

I looked at all the organization settings and project settings, but not able to find anything on the UI

Or else can it be set from YAML?

riQQ
  • 9,878
  • 7
  • 49
  • 66
harishr
  • 17,807
  • 9
  • 78
  • 125

3 Answers3

39

For a YAML pipeline the documentation says you can write

jobs:
- job: Test
  timeoutInMinutes: 10 # how long to run the job before automatically cancelling
  cancelTimeoutInMinutes: 2 # how much time to give 'run always even if cancelled tasks' before stopping them

timeoutInMinutes: 0 should also work for individual tasks, and 0 means max value (infinite for self-hosted agents).

Lars Pellarin
  • 606
  • 6
  • 10
  • 2
    If a jobs default timeout is 60 minutes and timeoutInMinutes is added to a task in that job, is the timeout now 60 + (timeoutInMinutes on task). So, for example, if I have task in a job that needs a timeoutInMinutes of 20. Is it 60 + 20 for that job? – Anthony Klotz Feb 24 '21 at 14:03
  • 2
    @AnthonyKlotz `timeoutInMinutes` will override the default. The description of that option confirms this "how long to run the job before automatically cancelling" See docs here https://learn.microsoft.com/en-us/azure/devops/pipelines/process/phases?tabs=yaml&view=azure-devops#timeouts – Just The Highlights Apr 01 '21 at 12:57
10

azure devops build pipeline reduce the timeout to 30 minutes

Edit the pipeline you want to modify. On the Options tab, there is an option Build job timeout in minutes, which you can set the Build job timeout, the default value is 60 minutes.

enter image description here

This timeout are including all tasks in your build pipeline rather than a particular job, if one of your build step out of time. Then the whole build definition will be canceled by the server. Certainly, the whole build fails and all subsequent steps are aborted.

Mark Wragg
  • 22,105
  • 7
  • 39
  • 68
Leo Liu
  • 71,098
  • 10
  • 114
  • 135
  • Your answer does not seem to be applicable for YAML based pipelines. I could not find any options tab when editing the pipeline. Also, if you go to triggers, there isn't any options tab there either. – dcp Aug 14 '23 at 13:56
1

As per documentation ,

On the Options tab you can specify default values for all jobs in the pipeline. If you specify a non-zero value for the job timeout, then it overrides any value that is specified in the pipeline options. If you specify a zero value, then the timeout value from the pipeline options is used. If the pipeline value is also set to zero, then there is no timeout.

more on,

https://learn.microsoft.com/en-us/azure/devops/pipelines/process/phases?view=azure-devops&tabs=classic&viewFallbackFrom=vsts#timeouts

Srinivasan Sekar
  • 2,049
  • 13
  • 22