Skip to content

Instantly share code, notes, and snippets.

@awesomebytes
Last active November 27, 2018 01:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save awesomebytes/6e13d17d262e4a32c3fa81b4b2df6a56 to your computer and use it in GitHub Desktop.
Save awesomebytes/6e13d17d262e4a32c3fa81b4b2df6a56 to your computer and use it in GitHub Desktop.
How to setup a longer timeout in azure pipelines

Longer timeout for azure pipelines builds

I came up with the error:

The job running on agent has exceeded the maximum execution time of 60.

I found different posts showing a graphical interface with an option to change that timeout that I could never find. But I found the way to do it from the YAML file azure-pipelines.yml.

Anything you are doing must be under the jobs construct to set the timeoutInMinutes parameter. In the default examples they don't use this jobs construct, I guess to simplify it, but that made me lose quite some time to find out how to do it.

azure-pipelines.yml should look like:

jobs:
  - job: "run stuff for max time"
    timeoutInMinutes: 0

    pool:
      vmImage: 'Ubuntu 16.04'

    steps:
    - script: docker build -f Dockerfile -t my_dockerfile_to_build .
      displayName: 'docker build'
      # This means up to 6h, this one must be <= the upper one... in theory, havent tested
      timeoutInMinutes: 0
      # Even if it fails I want to push the image to DockerHub for inspection
      continueOnError: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment