Increase Azure App Service HTTP Post Body Length Limit

Donovan Bouton 1 Reputation point
2022-01-12T23:03:11.427+00:00

My website, hosted on Azure App Service Plan, will not allow POST requests with a body larger than 100,000 characters.

Locally, the website will allow any limit.

How do I change this setting?

I do not see any Azure Web App Firewall within my App Service Plan or App Service.

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
6,897 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Ravikumar Narayanam 1 Reputation point Microsoft Employee
    2022-07-04T08:16:45.777+00:00

    Hi , To fix the Issue to allow max character's In the request, you need to make below changes In wwwroot folder.

    By default Request Limits value for the maxAllowedContentLength on IIS which is 30000000 (roughly 28.6MB) in Azure web app. To modify this value, add the following to your web.config file. And add this file under wwwroot

    1. Create web.config file in wwwroot folder If not exists and then add the below settings In that config file

    <configuration>
    <system.webServer>
    <security>
    <requestFiltering>
    <requestLimits maxAllowedContentLength="<valueInBytes>"/>
    </requestFiltering>
    </security>
    </system.webServer>
    </configuration>

    1. Mention the value how much you would like to allow in maxAllowedContentLength
    2. Save the changes , restart the Appservice and test the application.

    Reference :
    https://azureossd.github.io/2016/06/15/uploading-large-files-to-azure-web-apps/index.html