增加 Azure Api 应用程序中的最大请求长度

Increase the maximum request length in a Azure Api App

我创建了一个 Azure Api 应用程序,我将使用它来上传文件。这些文件将大于 4mb,因此需要增加最大请求长度。我已将以下内容添加到 Web.config:

 <system.web>
    <httpRuntime executionTimeout="7200" targetFramework="4.5" maxRequestLength="2097152" />
  </system.web>

我还补充了:

<system.webServer>
    <security>
      <requestFiltering>
        <requestLimits maxAllowedContentLength="2097152000" />
      </requestFiltering>
    </security>
  </system.webServer>

但我仍然遇到异常 Maximum request length exceeded.。我错过了什么吗?还有什么我可以尝试的吗?

谢谢!

不幸的是,这还不可能。除了 API 应用程序的限制外,同样是 ASP.NET 应用程序的网关也有限制。您可以更改 API 应用程序,但不能更改网关。

我知道团队正在研究为此提供解决方案,但我目前没有可分享的预计到达时间。