NodeJS App Service: upload requests are rejected when file is over 500kb

Asha 59 1 Reputation point
2022-10-17T16:36:03.96+00:00

We have a NodeJS app deployed on app service Linux (zip deploy)

In the app, there is a file upload form. It works well in local, for all file sizes.

When we deploy on Azure, the file upload only works for files under 500kb. When trying with a file above 500kb, we get a 413 error which is not returned by the app but by Azure itself.

How could we configure the app service to raise this limit ?

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
7,408 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. brtrach-MSFT 15,866 Reputation points Microsoft Employee
    2022-10-24T03:22:31.997+00:00

    Hello @Asha 59 We understand you are receiving 413 errors when uploading files to your web app.

    By default, the value is defined to a low number. You would need to use something like the below, which will define the limit.

    app.use(bodyParser.json({limit:  '10mb'}));  
    

    Please let us know if you have further questions or concerns.