1

I use Azure App Service with docker. When i trying to upload file with size more than 30 mb i get 500 http status. After logs investigation, i found error: Microsoft.AspNetCore.Server.Kestrel.Core.BadHttpRequestException: Request body too large. But when i run this docker image localy all ok. What could be the problem?

Vadim Bondaruk
  • 161
  • 1
  • 9

1 Answers1

0

For this error, you could try configure Limits.MaxRequestBodySize like

public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
    WebHost.CreateDefaultBuilder(args)
        .UseStartup<Startup>()
        .UseKestrel(opt => {
            opt.Limits.MaxRequestBodySize = null;
        });
Edward
  • 28,296
  • 11
  • 76
  • 121
  • @VadimBondaruk How did you deploy to Azure app service? Share us detail steps which could reproduce your issue. – Edward Sep 18 '19 at 08:26
  • configuration is the same as here: https://stackoverflow.com/questions/56482376/increasing-the-maximum-upload-size-limit-for-a-dockerized-asp-net-core-site-runn – Vadim Bondaruk Sep 19 '19 at 07:35
  • @VadimBondaruk How to reproduce your issue with the link? It works correctly at my side by above code and azure app service. – Edward Sep 19 '19 at 07:38