gpt4 book ai didi

azure - 是否有任何配置可以增加 Azure API 管理 (APIM) 的 URL 最大长度?

转载 作者:行者123 更新时间:2023-12-04 10:59:12 26 4
gpt4 key购买 nike

我有一个使用 Azure API 管理的 REST API,在使用大型查询字符串进行测试时,注意到一旦 URL 超过 1800 个字符左右,APIM 就不会路由请求,而是发回一条错误消息“找不到资源”且状态代码为 400。当我直接在本地向 REST 端点运行相同的请求时,它工作正常(我增加了 Kestrel 服务器最大请求长度,如我的 Program.cs 文件中所示:

WebHost.CreateDefaultBuilder(args)
.ConfigureKestrel((context, options) =>
{
options.Limits.MaxRequestLineSize = 2147483647;
options.Limits.MaxRequestBufferSize = 2147483647;
})
.UseStartup<Startup>();

我可以为 azure APIM 执行类似的配置来增加允许的最大 URL 大小吗?

最佳答案

所以回答我自己的问题:

联系了 Microsoft 支持,他们承认这是 APIM 消费层的限制。解决此问题的一种方法是切换到不同的层。我复制了从以下 Azure 支持获得的回复:

Root Cause:

For the previous investigation, this ticket is about the consumptiontier url limitation.

  1. As this configuration for the max URL length cannot be changed from the APIM policies. At this moment, the consumption tier have thislimitation from our backend setting which is already written into themain configuration.

  2. The consumption tier's url limit is like below. max url length: 4096 max query string length: 2048

The space will be changed as %20 which is 3 characters.

  1. The developer, basic and premium tier of APIM use the same backend structure and the restriction will not exist in this tiers differentfrom the consumption tier. These tiers will have over 10K url length.

关于azure - 是否有任何配置可以增加 Azure API 管理 (APIM) 的 URL 最大长度?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58945507/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com