首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >错误- 403禁止-Microsoft-Azure-应用程序-Gateway/v2

错误- 403禁止-Microsoft-Azure-应用程序-Gateway/v2
EN

Stack Overflow用户
提问于 2021-03-26 16:55:10
回答 1查看 7.9K关注 0票数 1

当我试图将下面的请求发送到.net核心web时,我得到的错误为"403禁止-Microsoft应用程序-网关/v2“。我对encodeEmailBody属性使用了HTML编码。

网络应用程序代码:-

代码语言:javascript
运行
复制
[HttpPut("UpdateEmail")]
[Produces("application/json")]
public async Task<IActionResult> UpdateEmailAsync([FromBody] EmailRequest emailRequest)
{
    var result = await _businessService.UpdateEmailAsync(emailRequest);
    return Ok(result);
}

请求类

代码语言:javascript
运行
复制
public class EmailRequest
{
    public Guid EmailTemplateTypeId { get; set; }
    public string EncodeEmailSubject { get; set; }
    public string EncodeEmailBody { get; set; }
    public Guid CountryId { get; set; }
}

请求

代码语言:javascript
运行
复制
{
  "emailTemplateTypeId": "4C4B989B-769B-4999-8109-5A51199C09A8",
  "encodeEmailSubject": "test",
  "encodeEmailBody": "&lt;p&gt;The retention file MXMT generation for the &quot;&lt;&lt;EngagementName&gt;&gt;&quot; did not complete successfully.&lt;p&gt;&lt;p&gt;Please contact your local country helpdesk  support function.&lt;p&gt;&lt;hr&gt;&lt;i&gt;This is an automatically generated email. Please do not respond to this email. The mailbox is not b",
  "countryId": "47E37625-ECC5-4F68-ACA6-61432787390D"
}

错误:-

代码语言:javascript
运行
复制
<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 -->

注意:当我在本地调用这个API时,它可以正常工作,但不能在服务fabric节点上工作。

任何帮助都是可以接受的。

EN

回答 1

Stack Overflow用户

发布于 2021-03-26 20:23:25

此请求将由您服务前面的Azure应用程序网关停止。

https://learn.microsoft.com/en-us/azure/application-gateway/overview

Azure应用程序网关包括防火墙(WAF)

问题可能是WAF将您的请求标记为恶意。您需要首先检查防火墙上的日志,以了解它被阻塞的原因,然后禁用阻止请求的规则,或者创建一个异常规则以允许特定的url通过。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/66821199

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档