简体   繁体   English

Azure API 应用程序抛出请求大小限制错误

[英]Azure API App Throwing Request Size constraints Errors

I have a sample API hosted in Azure API App as https://epdpoc.azurewebsites.net/swagger/index.html This is API.NET Core 5.0 based Web API.我在 Azure API 应用程序中托管了一个示例 API,如https://epdpoc.azurewebsites.net/swagger/index.html这是基于 API.NET Core 5.0 的 Web API。 The 2nd paramter, htmlText, to pass as querystring.第二个参数 htmlText 作为查询字符串传递。 The query string value is as below查询字符串值如下

<table border="0" width="100%">
<tr>
<td width ="50%">&nbsp;</td>
<td width = "50%">&nbsp;</td>
</tr>
<tr><td colspan=2><font face="Arial" size="2" >
{{SALUTATION}}<br>

<font color="blue"><b>Attachments can be located below the Subject line or at the end of the email.  For the Policy or Endorsement documents, please follow the AEPEx process.</font></b><br><br>

Thank you for choosing Zurich. Providing high-quality insurance solutions to our customers is a priority we share, and we appreciate your trust and your business. <br><br>

We are pleased to inform you that any policies, endorsements or audits that are associated with the policy number(s) referenced below will be delivered by Aon via AEPEx <font color="blue"><b>(normally within two business days)</font></b>, per Aon's request. Please make sure that all Bridge headers have been updated to ensure that your document(s) is/are delivered to you, via AEPEx, as quickly as possible.<br><br>

<font color="blue"><b>AON has requested Zurich to not forward attachments that will be delivered via AEPEx.  If you have any questions concerning this policy, please contact your office AEPEx Champion.</font></b><br><br>

Please distribute a copy to the client along with all other relevant information.<br><br>

Our commitment does not stop here. We pride ourselves on helping customers protect what they value most, and that goal includes cultivating an effective and collaborative working relationship with you. We strive to exceed your expectations with personalized and responsive service. Should you have any questions or suggestions, do not hesitate to contact your Zurich International Service Representative listed below.<br><br>

We look forward to working together on behalf of our valued customers.<br><br>
</font></td></tr>

<tr><td align="left" valign="top"><font face="Arial" size="2"><b>
Customer Name:
</b></font></td>
<td valign="top" colspan=3><font face="Arial" size="2">
{{CUST_NM}}
</font></td></tr>

<tr><td align="left" valign="top"><font face="Arial" size="2"><b>
Policy Number(s)/Effective Date(s):
</b></font></td>
<td valign="top" colspan=3><font face="Arial" size="2">
{{POL_NUM}}
</font></td></tr>

<tr><td align="left" valign="top" colspan=4><font face="Arial" size="2"><b>
International Service Representative contact information:</b></font></td></tr>

<tr><td align="left" valign="top"><font face="Arial" size="2"></font></td>
<td align="left" valign="top"><font face="Arial" size="2" colspan=3>
{{UDW_ASSIST_NM}}<br>
{{UDW_ASSIST_PHONE}}<br>
{{UDW_ASSIST_EMAIL}}<br>
</font></td>
<td valign="top"><font face="Arial" size="2">
</font></td></tr>

</table>

<br><font face="Arial" size="2">
{{COMMENTS}}
</font><br>
<br>

<table width="100%" border="1">

<tr><td valign="top" width="50%"><font face="Arial" size="2" color="blue">
<b>Useful links for Brokers:</b><br><br>
<a href=https://www.zurichna.com/en/brokers>Zurich Broker Resource Center</a>
<br><br>
<a href=https://www.zurichna.com/>Zurich North America website</a>
<br><br>
<a href=https://www.zurichna.com/en/industries/international/largeintl>Zurich solutions for Large Multinational Global</a>
<br><br>
<a href=https://www.zurichna.com/en/brokers/appetites>Zurich appetite and contacts guide for Brokers</a>
<br><br>
</font></td>

<td valign="top" width="50%"><font face="Arial" size="2" color="blue">
<b>Useful links for Clients:</b><br><br>
<a href=https://www.zurichna.com/en/claims>Zurich Claims Website (with kits and reporting guide)</a>
<br><br>
<a href=https://www.zurichna.com/_/media/dbe/zna/docs/claims/zurich-accident-assistance-guide.pdf>Zurich accident assistance guide (driver kit)</a>
<br><br>
<a href=http://www.zurichna.com/en/risk>Zurich Risk Engineering</a><br><br>
<a href=https://esolutions.zurichna.com/s3/Boiler-Inspection-Request-System>Boiler inspection request online</a><br><br>
</font></td></tr>
</table>

I have one Web.Config by setting request size as below.通过如下设置请求大小,我有一个 Web.Config。

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <!-- To customize the asp.net core module uncomment and edit the following section. 
  For more info see https://go.microsoft.com/fwlink/?linkid=838655 -->
  <system.webServer>
    <handlers>
      <remove name="aspNetCore" />
      <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
    </handlers>
    <aspNetCore processPath="%LAUNCHER_PATH%" arguments="%LAUNCHER_ARGS%" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" hostingModel="InProcess" />
    <security>
      <requestFiltering>
        <!-- This will handle requests up to 50MB -->
        ***<requestLimits maxAllowedContentLength="52428800" />***
      </requestFiltering>
    </security>
  </system.webServer>
</configuration>

Still I am getting request size constraits error from API App as below.我仍然收到来自 API App 的请求大小限制错误,如下所示。

Verify the configuration/system.webServer/security/requestFiltering/requestLimits@maxQueryString setting in the applicationhost.config or web.config file.验证 applicationhost.config 或 web.config 文件中的 configuration/system.webServer/security/requestFiltering/requestLimits@maxQueryString 设置。

Any clue here?这里有什么线索吗? Any additional settings to do?有什么额外的设置要做吗?

  • The fix is to change the maxQueryString setting (or maxUrl if the problem is in the path).修复方法是更改​​ maxQueryString 设置(如果问题出在路径中,则更改为 maxUrl)。 To do so, modify the security element in the web.config file:为此,请修改 web.config 文件中的安全元素:

     <system.webServer> <security> <requestFiltering> <requestLimits maxUrlLength="10999" maxQueryString="2097151"/> </requestFiltering> </security> </system.webServer>
  • Set the maxQueryStringLength property in the tag:在标签中设置 maxQueryStringLength 属性:

     <system.web> <httpRuntime maxUrlLength="10999" maxQueryStringLength="2097151" enable="true"/> </system.web>

maxQueryStringLength defaults to 2048. maxQueryStringLength 默认为 2048。

Note : above mentioned is just an example.注意:上面提到的只是一个例子。 set value according to your requirement.根据您的要求设置值。

Please refer Configuration Sample for more details.有关详细信息,请参阅配置示例

暂无
暂无

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

相关问题 Azure function 应用程序 - 数据自动 escaping 引用和抛出错误 - Azure function app - Data automatically escaping quotes and throwing errors 创建逻辑应用程序时Azure上的API错误 - API Errors on Azure while creating a Logic App 增加Azure Api应用程序中的最大请求长度 - Increase the maximum request length in a Azure Api App IIS和IIS Express在本地为MVC4 Azure应用程序抛出403错误 - IIS & IIS Express throwing 403 errors locally for MVC4 Azure app Azure 应用服务 Java - 上传请求因大小而失败 - Azure App Service Java - Post request for upload failing for size 运行PHP API的Azure Web App的随机404错误 - Random 404 errors for Azure Web App running a PHP API 在应用程序池被回收之前,Azure上的Web API错误 - Web API on Azure errors until App Pool is Recycled Azure 存储表 Rest API 正在抛出 403 - 即使通过了身份验证令牌,服务器也无法对请求进行身份验证 - Azure storage tables Rest API is throwing 403 - Server failed to authenticate the request even though auth token is passed 在 Azure 应用服务上运行的 ASP.NET Core 3.1 应用引发 1.6 MB json 有效负载的 EPIPE 错误 - ASP.NET Core 3.1 app running on Azure App Service throwing EPIPE errors for 1.6 MB json payload 使用自定义 Api 作为通知侦听器的验证请求上的 Microsoft Azure Graph API 订阅错误 - Microsoft Azure Graph API Subscription Errors on Validation request using Custom Api as Listener for notifications
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM