0

I created a very simple Durable function to test the ability of setting a timeout threshold of 60 minutes.

My target framework is .NET 8.0 and I using the Isolated model for my function.

According to everything I've read, I can override the default timeout of 30 minutes by setting it in the host.json file. Mine looks like this:

{
  "version": "2.0",
  "logging": {
    "applicationInsights": {
      "samplingSettings": {
        "isEnabled": true,
        "excludedTypes": "Request"
      },
      "enableLiveMetricsFilters": true
    },
    // Set functionTimeout to "No Limit"
    // Generally not recommended, just in case of infinite loop scenarios
    "functionTimeout": "00:60:00",
    "extensions": {
      "durableTask": {
        "maxConcurrentActivityFunctions": 25,
        "extendedSessionsEnabled": false
      }
    }
  }
}

Everytime I've ran a test scenario that takes more than 30 minutes I receive the following output at the console.

Timeout value of 00:30:00 exceeded by function 'Functions.FunctionName' (Id: '101d29bd-3353-4ff6-89cf-66e1278e88dc'). Initiating cancellation

I am running the tests solely within Visual Studio 2022 in effort of creating a prototype for my company, so I haven't deployed anything to Azure yet.

But my expectation was that if my process runs anywhere between more than 30 but less than 60 minutes, I shouldn't be receiving the default timeout error. Is the only way to fully proof out the timeout setting to deploy it to Azure???

What am I doing wrong?

1 Answer 1

0

You are doing everything correctly, but the problem is that functionTimeout doesn´t work with durable functions.

Source - https://learn.microsoft.com/en-us/answers/questions/1657946/azure-durable-functions-run-only-10-minutes-on-pre

You will have to use Durable function timeout settings. for example

{
  "version": "2.0",
  "extensionBundle": {
    "id": "Microsoft.Azure.Functions.ExtensionBundle",
    "version": "[4.*, 5.0.0)"
  },
  "extensions": {
    "durableTask": {
      "hubName": "YourDurableFunctionsHubName",
      "orchestration": {
        "orchestrationTimeout": "00:30:00"
      }
    }
  },
  "functionTimeout": "00:30:00"
}

More Information - https://learn.microsoft.com/en-us/azure/azure-functions/durable/durable-functions-bindings?tabs=python-v2%2Cin-process%2C2x-durable-functions&pivots=programming-language-csharp#host-json

If though you choose to use durable functions, if you still want to use functionTimeout you can use functionTimeout: -1

{
  //Removed 
  "functionTimeout": "-1" //this will not work with consumption plan.
}

For more about timeout - https://learn.microsoft.com/en-us/azure/azure-functions/functions-scale#timeout

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.