I started working on a solution that is including an Azure Function triggered from an HTTP request that can contain a file in the request as form data. When calling it with a large file (say 175 MB), the request ends in a 413 Request body too large.
I've seen from many search results that the default limit for Azure Functions is 100 MB, for example Azure functions v3 /HTTP trigger functions : Limiting the request body and URL size
I tried to add a web.config
to my Azure Function App project with the reference to web.config example from above link. But it does not fix the problem and I am not even sure the web.config
file is recognized in a Azure Function App project.
Here is the general look of the Azure Function app project:
Here is the definition of the Azure function as well as how it's reading the form data:
[FunctionName("XXX")]
public async Task<IActionResult> Run([HttpTrigger(AuthorizationLevel.Anonymous, "post", Route = null)] HttpRequest httpRequest, ILogger logger)
{
logger.LogInformation("logging");
var formdata = await httpRequest.ReadFormAsync();
string sourceId = formdata["sourceId"];
string source = formdata["source"];
string language = formdata["language"];
string user = formdata["user"];
string dropFolderName = formdata["dropFolderName"];
string workgroup = formdata["workgroup"];
...
Question is
What is the correct way to increase the "maximum request size" for an Azure Function that is triggered from an http request in .NET Core 3.1?