[英]Error - 403 Forbidden - Microsoft-Azure-Application-Gateway/v2
When I try to send the below request to .net core web api, I am getting the error as "403 Forbidden - Microsoft-Azure-Application-Gateway/v2".当我尝试将以下请求发送到 .net 核心 web api 时,我收到的错误为“403 Forbidden - Microsoft-Azure-Application-Gate”。 I have used the HTML encoding for encodeEmailBody property.
我对encodeEmailBody属性使用了 HTML 编码。
Web Api Code:- Web Api 代码:-
[HttpPut("UpdateEmail")]
[Produces("application/json")]
public async Task<IActionResult> UpdateEmailAsync([FromBody] EmailRequest emailRequest)
{
var result = await _businessService.UpdateEmailAsync(emailRequest);
return Ok(result);
}
Request Class请求 Class
public class EmailRequest
{
public Guid EmailTemplateTypeId { get; set; }
public string EncodeEmailSubject { get; set; }
public string EncodeEmailBody { get; set; }
public Guid CountryId { get; set; }
}
Request要求
{
"emailTemplateTypeId": "4C4B989B-769B-4999-8109-5A51199C09A8",
"encodeEmailSubject": "test",
"encodeEmailBody": "<p>The retention file MXMT generation for the "<<EngagementName>>" did not complete successfully.<p><p>Please contact your local country helpdesk support function.<p><hr><i>This is an automatically generated email. Please do not respond to this email. The mailbox is not b",
"countryId": "47E37625-ECC5-4F68-ACA6-61432787390D"
}
Error:-错误:-
<html>
<head><title>403 Forbidden</title></head>
<body>
<center><h1>403 Forbidden</h1></center>
<hr><center>Microsoft-Azure-Application-Gateway/v2</center>
</body>
</html>
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
NOTE: When I call this API locally, it is working fine but not working on service fabric node .注意:当我在本地调用此 API 时,它工作正常,但不能在service fabric node上工作。
Any help will be apricated.任何帮助将不胜感激。
The request is being stopped by the Azure Application Gateway that is in front of your service.该请求被您的服务前面的 Azure 应用程序网关停止。
https://docs.microsoft.com/en-us/azure/application-gateway/overview https://docs.microsoft.com/en-us/azure/application-gateway/overview
Azure Application Gateway includes a Firewall (WAF) Azure 应用程序网关包括防火墙 (WAF)
The problem is probably that the WAF is flagging your request as malicious.问题可能是 WAF 将您的请求标记为恶意请求。 You need to first check the logs on the firewall to see why it is being blocked, then either disable the rule that is blocking the request, or create an exception rule to allow that specific url through.
您需要首先检查防火墙上的日志以了解其被阻止的原因,然后禁用阻止请求的规则,或创建例外规则以允许特定的 url 通过。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.