Azure function (HTTP response content Limit for Input Stream Or Base64 Content) is there Any limit to send ????

Jeet Jangir 1 Reputation point
2023-01-05T09:13:56.583+00:00

Is there any limit to sending(Like InputStream Data) HTTP Trigger Response in Azure Function?

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,415 questions
{count} votes

2 answers

Sort by: Most helpful
  1. satya karki 991 Reputation points MVP
    2023-01-11T14:39:57.9866667+00:00

    Hi,

    You can increase the file size.

    int size = 20971520;
    file.OpenReadStream(20971520);
    
    0 comments No comments

  2. MuthuKumaranMurugaachari-MSFT 22,401 Reputation points
    2023-01-17T21:57:20.7466667+00:00

    @Jeet Jangir To summarize, we do have Http Request Limit of 100MB as mentioned in docs: Limits. However, for Http Response, the limit depends on how you process the file. If you try to download a very large file into memory, then JVM heap would run into out of memory and will fail.

    With InputStream approach, you should be able to process large file like 800MB, but it will also fail if you try to convert all stream content to an object (which loads into memory). So basically, it depends on what you are doing with InputStream.

    From the snippet, you are returning stream in the response body, but additional details like where you are downloading this stream, use case, full snippet etc. would really help. We can try to come up with some code samples or suggest alternatives such as blob output trigger (where they can pass their file to a blob storage) for your scenario.

    I hope this helps and feel free to add a comment for any questions. Would be happy to answer any.


Your answer

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