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?
Asked
Active
Viewed 495 times
1
-
A little more context would help. Upload how? – tadman Sep 17 '19 at 19:43
-
Uploading using form data and web api controller – Vadim Bondaruk Sep 17 '19 at 19:46
-
That's a really vague explanation. Can you show code or commands you're running? – tadman Sep 17 '19 at 19:47
-
Code is very simple and typical, web api controller with action method wich takes object with IFormFile property – Vadim Bondaruk Sep 17 '19 at 19:52
-
How did you deploy docker image to Azure App Service? – Edward Sep 18 '19 at 02:49
1 Answers
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