Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
Based on your issue description, I understand the same config works fine on Linux, but not on Windows. Just confirming, if the same issue happens locally?
I have also added additional tags' to receive insights from the targetted SMEs.
If you haven't done this already, to increase the request length in your Web API 6 project, you can add the following code in the Startup.cs file:
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.DependencyInjection;
namespace WebApi6
{
public class Startup
{
public void ConfigureServices(IServiceCollection services)
{
services.Configure<FormOptions>(x =>
{
x.ValueLengthLimit = int.MaxValue;
x.MultipartBodyLengthLimit = int.MaxValue;
x.MultipartHeadersLengthLimit = int.MaxValue;
});
}
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
app.UseMvc();
}
}
}
The above code sets the maximum length for the request body, the multipart body, and the multipart headers to the maximum value that can be represented by an integer.
If you haven't done this already so, you may also set the maximum length to a specific value, such as 300 MB, by replacing int.MaxValue with the desired value in bytes.