简体   繁体   中英

How to configure Azure functions V3 to allow 50+MB files when running locally

Like this closed issue https://github.com/Azure/azure-functions-host/issues/5540 I have issues figuring out what setting I should be changing to allow 100MB files to be uploaded

The weird thing is that the system is deployed in Azure where big files are allowed, but no one have made any changes to settings that should affect this.

So is there some local.settings.json setting that I am missing that is default different when hosting in Azure when compared to localhost

Error:

Microsoft.Azure.WebJobs.Host.FunctionInvocationException: Exception while executing function: MessageReceiver ---> System.InvalidOperationException: Exception binding parameter 'request' ---> Microsoft.AspNetCore.Server.Kestrel.Core.BadHttpRequestException: Request body too large.

There is https://learn.microsoft.com/en-us/do.net/api/microsoft.as.netcore.server.kestrel.core.kestrelserverlimits.maxrequestbodysize?view=as.netcore-3.1

But I cant figure out how to set that when running Azure functions, in the startup I cant set it and setting [DisableRequestSizeLimit] or [RequestSizeLimit(100000000)] on top of my Azure function have no effect

A bug has been reported with problems on Windowshttps://github.com/Azure/azure-functions-core-tools/issues/2262

The HTTP request length is limited to 100 MB (104,857,600 bytes), and the URL length is limited to 4 KB (4,096 bytes). These limits are specified by the httpRuntime element of the runtime's Web.config file.

If a function that uses the HTTP trigger doesn't complete within 230 seconds, the Azure Load Balancer will time out and return an HTTP 502 error. The function will continue running but will be unable to return an HTTP response. For long-running functions, we recommend that you follow async patterns and return a location where you can ping the status of the request. For information about how long a function can run, see Scale and hosting - Consumption plan .

For more details, you could refer to this article .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM