简体   繁体   English

Azure functions v3 /HTTP trigger functions: Limiting the request body and URL 大小

[英]Azure functions v3 /HTTP trigger functions : Limiting the request body and URL size

I would like to see how I can limit the maxRequestLength and maxAllowedContentLength properties in an API that was created using HTTP triggers with Azure functions v3 (using.Net core app 3.1)我想看看如何限制 API 中的maxRequestLengthmaxAllowedContentLength属性,该属性是使用 HTTP 触发器和 Azure 函数 v3(使用.Net 核心应用程序 3.1)创建的

I have tried using a web.config file that just got ignored (expected).我尝试使用刚刚被忽略(预期)的web.config文件。 But I'm not sure what other options can be done.但我不确定还有哪些其他选择可以完成。 Please note that I'm trying to decrease the default limits not increase them !请注意,我正在尝试降低默认限制而不是增加它们!

Any help would be much appreciated.任何帮助将非常感激。 Thanks!谢谢!

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). HTTP 请求长度限制为 100 MB(104,857,600 字节),URL 长度限制为 4 KB(4,096 字节)。 These limits are specified by the httpRuntime element of the runtime's Web.config file.这些限制由运行时的 Web.config 文件的 httpRuntime 元素指定。

https://learn.microsoft.com/en-us/azure/azure-functions/functions-bindings-http-webhook-trigger?tabs=csharp https://learn.microsoft.com/en-us/azure/azure-functions/functions-bindings-http-webhook-trigger?tabs=csharp

reference to web.config https://github.com/Azure/azure-functions-host/blob/v3.x/src/WebJobs.Script.WebHost/web.config参考web.config https://github.com/Azure/azure-functions-host/blob/v3.x/src/WebJobs.Script.WebHost/web.config

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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