Attempting to upload a file larger than 28.6MB to Azure Web Apps can result in a HTTP 404.13 for WordPress developers or a HTTP 502 for Tomcat Manager. This can be due to the default Request Limits value for the maxAllowedContentLength on IIS which is 30000000 (roughly 28.6MB). To modify this value, add the following to your web.config file.
<configuration> <system.webServer> <security> <requestFiltering> <requestLimits maxAllowedContentLength="<valueInBytes>"/> </requestFiltering> </security> </system.webServer> </configuration>
You may also need to make changes to your Web App to increase the maximum file upload size as well. Below is some additional information for how to increase the limits for popular Content Management Systems that run on PHP such as WordPress, Drupal, and Joomla!. Information for Tomcat Manager can be found here.
PHP Content Management Systems (WordPress, Joomla!, etc.)
App Service Windows
WordPress and other CMS site have its own maximum file upload size which are based on the default PHP values. These can be modified by creating a “.user.ini” file. Azure Web Apps developers can create/modify this file by performing the following.
Go to your KUDU console (https://<sitename>.scm.azurewebsites.net/debugconsole)
Go to the “site” directory then the “wwwroot” directory.
To create a “.user.ini” file, go to the console window below and type “touch .user.ini”.
Add the following values to the file and press Save.
upload_max_filesize = 64M post_max_size = 64M
Restart your site.
App Service Linux
For App Service Linux, please see steps at Updating PHP Settings
NOTE: For WordPress Multisite users, you will also need to modify the Network Admin Settings to increase the value.