Azure API App in premium plan is throwing 413 error(Linux+Java)

Pratim Das, Partha C 306 Reputation points
2024-07-26T16:26:41.3333333+00:00

Hi Team,

I need one urgent solution and I know this forum is my last resort.

Problem statement: I have an Azure API APP. This is supposed to get 200 MB data as body of the HTTP request. We rejected Azure Function as HTTP triggered Function can't accept load beyond 100 MB.

My Azure API app is written in Java and OS is linux. How can I configure the server to accept 200 MB data as payload from HTTP request?

Quick help will be highly appreciated.

Regards,

Partha

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,101 questions
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
7,907 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. hossein jalilian 8,160 Reputation points
    2024-07-26T20:08:52.8766667+00:00

    Hello Pratim Das, Partha C,

    Thanks for posting your question in the Microsoft Q&A forum.

    You'll need to adjust several settings. Here's how to address this issue:

    • Increase the request body size limit in your Java application, if you're using Spring Boot, add the following to your application.properties file
        spring.servlet.multipart.max-file-size=200MB
      

    spring.servlet.multipart.max-request-size=200MB

      
    - Update the web.config file in your project's root directory with the following content
    
      ```xml
      <?xml version="1.0" encoding="UTF-8"?>
      <configuration>
          <system.webServer>
              <security>
                  <requestFiltering>
                      <requestLimits maxAllowedContentLength="209715200" />
                  </requestFiltering>
              </security>
          </system.webServer>
      </configuration>
    
    • In the Azure Portal, go to your App Service and add the following application setting
        WEBSITE_WEBROOT_MAX_BODY_SIZE=209715200
      
    • Since large payloads may take longer to process, consider increasing the timeout settings in your App Service configuration:
        WEBSITE_HTTPLOGGING_RETENTION_DAYS=7
      

    WEBSITE_SCM_IDLE_TIMEOUT_IN_MINUTES=30

      
    ***
    
    Please don't forget to close up the thread here by **upvoting** and **accept it as an answer** if it is helpful
    
    
    0 comments No comments

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.