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

Ale*_*lex 5 c# api file-upload azure azure-api-apps

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

 <system.web>
    <httpRuntime executionTimeout="7200" targetFramework="4.5" maxRequestLength="2097152" />
  </system.web>
Run Code Online (Sandbox Code Playgroud)

我还补充道:

<system.webServer>
    <security>
      <requestFiltering>
        <requestLimits maxAllowedContentLength="2097152000" />
      </requestFiltering>
    </security>
  </system.webServer>
Run Code Online (Sandbox Code Playgroud)

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

谢谢!

Pan*_*nos 1

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

我知道团队正在考虑提供解​​决方案,但目前我没有可以分享的预计到达时间。