MaxRequestBodySize is not working when its deployed to webserver with Azure App Service but it works in my local. I tried with the below changes in program.cs and startup.cs of my .net core 3.1 but none of them worked. Still getting 413 (Request Entity Too Large) error.
Program.cs:
1. webBuilder.ConfigureKestrel(serverOptions =>
{
serverOptions.Limits.MaxRequestBodySize = long.MaxValue;
})
2. .UseKestrel(options =>
{
options.Limits.MaxRequestBodySize = long.MaxValue;
}
Startup.cs
services.Configure<IISServerOptions>(options => options.MaxRequestBodySize = long.MaxValue);