request timeout issue in http trigger in azure function app

Abdul Hanan 20 Reputation points
2025-12-02T14:08:46.75+00:00

when i process less than 3 mb pdf file in azure function app it performs Document Intelligence and the extracted text convert into Json and return in Json format but when I upload more than 3 mb file it always shows request timeout why??

Executing 'Functions.main' (Reason='This function was programmatically called via the host APIs.', Id=8a6ae74a-8dff-4efc-9696-ca4d0f0b5c1c)

Received FunctionInvocationRequest, request ID 18a1b8e2-ae04-427a-be96-b56e5eec536b, function_id: 5753ee74-d6f5-5407-86de-f5c1599d258a,invocation_id: 8a6ae74a-8dff-4efc-9696-ca4d0f0b5c1c, worker_id: be3b67ee-4608-41a4-90f8-135d30d11f3f

Gpt shows that http trigger remains only for 230 sec then crash!?

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
0 comments No comments
{count} votes

Answer accepted by question author
  1. Adam Zachary 2,025 Reputation points
    2025-12-02T15:28:23.66+00:00

    Hi Abdul,

    What you are hitting is not a Document Intelligence file size limit, it is the HTTP timeout limit for Azure Functions.

    For any HTTP triggered Azure Function, Azure’s load balancer will only wait 230 seconds for a response. After 230 seconds it returns a timeout to the caller, even if the function is still running in the background. This 230-second limit applies regardless of functionTimeout or hosting plan.

    Your small PDFs finish under 230 seconds, so they work. Larger PDFs take longer to run through Document Intelligence, cross that 230-second threshold, and the request times out.

    To handle bigger documents you have to switch to an asynchronous pattern instead of doing all the work inside the HTTP request, for example:

    HTTP trigger only uploads the file to Blob Storage and puts a message on a queue or starts a Durable Functions orchestration.

    Return a 202 Accepted with an operation ID.

    Use a queue trigger or Durable Function to call Document Intelligence and write the JSON result back to storage.

    The client polls a status endpoint or reads the result later.

    That way the actual processing is not limited by the 230-second HTTP timeout, and you can still process larger files.

    0 comments No comments

2 additional answers

Sort by: Most helpful
  1. Q&A Assist
    2025-12-02T14:08:59.5033333+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    The request timeout issue you are experiencing with your Azure Function app when processing files larger than 3 MB is likely due to the maximum execution time limit for HTTP triggered functions. According to Azure Functions documentation, the maximum amount of time that an HTTP triggered function can take to respond to a request is 230 seconds. If your function does not return a response within this time frame, it will timeout, leading to the error you are encountering.

    For processing larger files or long-running tasks, you may want to consider using the Durable Functions async pattern or deferring the actual work and returning an immediate response. This approach allows you to handle longer processing times without hitting the timeout limit.


    References:

    0 comments No comments

  2. Aditya N 955 Reputation points Microsoft External Staff Moderator
    2025-12-02T14:13:56.9066667+00:00

    Hello @Abdul Hana

    1. Understand the Timeout Limitations: For HTTP-triggered functions in the Consumption plan, the maximum timeout is 5 minutes (300 seconds), and for Premium and Dedicated plans, it can reach up to 30 minutes, but a specific HTTP response must be sent within 230 seconds due to Azure's Load Balancer idle timeout.
    2. Break Down Your Processes: If your function takes longer than the allowed timeout, it’s best to refactor your code. Instead of processing large files in a single function, consider using an asynchronous design:
      • Use Durable Functions to handle long-running processes. This allows your function to return a 202 Accepted response immediately while the processing continues in the background.
      • This approach can help avoid timeout issues by managing the execution state and letting clients proceed without blocking.
    3. Check Your Function Configuration:
      • Ensure you're not hitting any restrictions imposed by the plan you're using. If you are consistently exceeding the time limit, evaluate if you need to upgrade your function app plan.
    4. Monitoring and Logging: Enable Application Insights to monitor your function's execution. Check the logs when processing larger files; it can highlight sufficiency or performance issues.
    5. Error Handling: Make sure to include robust error handling in your function. If there’s an error during processing, it can lead to timeouts and crashes.

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.