Toto
Toto

Reputation: 139

Azure App Service IIS "maxRequestLength" setting

I have a NodeJS application deployed on a Azure App Service. Doing a post with a file of 38 MB I obtain a 404 error but under the hood there is a IIS problem "Request filtering is configured on the Web server to deny the request because the content length exceeds the configured value."

To set 'maxAllowedContentLength' I have to edit 'web.config' file.

This is not good because if I do some change on the Azure Portal App Settings my local version of web.config' goes in conflict with the auto-generated file.

Is it possible to set on 'maxAllowedContentLength' in a different way ?

Upvotes: 2

Views: 11907

Answers (1)

Fei Han
Fei Han

Reputation: 27793

"Request filtering is configured on the Web server to deny the request because the content length exceeds the configured value."

As far as I know, the default value of maxAllowedContentLength is 30000000 (approximately 28.6MB). We could connecting to a Windows Azure Website from IIS Manager with remote administration, and then we could find the request limits, like this.

enter image description here

So the request will fail when you post about 38MB data. On my side, I increase the value of maxAllowedContentLength in web.config, I could post the data that is larger than 28.6MB from my Web API.

<security>
  <requestFiltering>
    <requestLimits maxAllowedContentLength="<valueInBytes>"/>
  </requestFiltering>
</security>

Request to my Web API:

enter image description here

You could configure/modify maxAllowedContentLength property in your local web.config and deploy your app with web.config to your Azure Website. If you get any conflict error, please share us the error details.

Upvotes: 2

Related Questions