skip to Main Content

I got a function app which can have a very long running operation. I am triggering it with an Azure yaml pipeline like this:

- task: AzureFunction@1
  displayName: Run Dummy function
  inputs:
    function: '$(FunctionURL)/api/DummyFunction'
    key: '$(FunctionKey)'
    method: 'POST'
    body: $(AzureFunctionBody)        
    waitForCompletion: 'true'

Every time I run the pipeline, it fails with an error message:

            > Response Code: 0
            > Response: An error was encountered while processing request. Exception: 
            > Exception Message: The request timed out after 60 seconds as no response was received. (type TimeoutException)

Even though I get an exception in the pipeline, the function app itself is being triggered and fully runs without any issues.

How can I make the pipeline wait for the function app to finish, even if it means waiting for hours?

2

Answers


  1. How can I make the pipeline wait for the function app to finish, even if it means waiting for hours?

    You can use the job timeout setting to specify the limit in minutes for running the job – example:

    jobs:
    - job: Deploy
      timeoutInMinutes: 0
      steps:
        # ...
    

    Setting the value to zero means that the job can run:

    • Forever on self-hosted agents
    • For 360 minutes (6 hours) on Microsoft-hosted agents with a public project and public repository
    • For 60 minutes on Microsoft-hosted agents with a private project or private repository (unless additional capacity is paid for)
    Login or Signup to reply.
  2. I’m afraid that you won’t be able to change this timeout. Look at a post here in Developer Community

    As you observed, we have a hard restriction on agentless tasks to a timeout of 60 seconds. If http request takes more than 60 secs to complete, then you should use async mode which means that ‘WaitForCompletion’ property is set to true.

    We will close this ticket since it is as designed. If the solution/workaround does not work, please feel free to let us know and we will reopen the ticket and continue to investigate this issue.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search