Azure Function app timeout in 4 minutes (230 seconds)

Shirvadkar, Virendra 0 Reputation points
2024-05-29T03:08:44.4366667+00:00

I am getting 500 Timeout issue while running function app for more than 4 minutes (230 seconds). It was working for 30 minutes when we were using .net 6 version. Suddenly we started getting 500 timeout when we updated function app to .net 8 version.

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,517 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,528 questions
{count} votes

1 answer

Sort by: Most helpful
  1. SwathiDhanwada-MSFT 18,211 Reputation points
    2024-05-29T04:36:45.53+00:00

    @Shirvadkar, Virendra The timeout duration for functions in a function app is defined by the functionTimeout property in the host.json project file. This property applies specifically to function executions. After the trigger starts function execution, the function needs to return/respond within the timeout duration. For more information, see Improve Azure Functions performance and reliability.

    The following table shows the default and maximum values (in minutes) for specific plans:

    Expand table

    Plan Default Maximum1
    Consumption plan 5 10
    Consumption plan 5 10
    Flex Consumption plan 30 Unlimited3
    Premium plan 302 Unlimited3
    Dedicated plan 302 Unlimited3
    1. Regardless of the function app timeout setting, 230 seconds is the maximum amount of time that an HTTP triggered function can take to respond to a request. This is because of the default idle timeout of Azure Load Balancer. For longer processing times, consider using the Durable Functions async pattern or defer the actual work and return an immediate response.
    2. The default timeout for version 1.x of the Functions runtime is unlimited.
    3. Guaranteed for up to 60 minutes. OS and runtime patching, vulnerability patching, and scale in behaviors can still cancel function executions so ensure to write robust functions.
    4. In a Flex Consumption plan, the host doesn't enforce an execution time limit. However, there are currently no guarantees because the platform might need to terminate your instances during scale-in, deployments, or to apply updates.
    0 comments No comments