I am new to Azure.
when I am trying to upload the particular image through my application to the Azure storage account. I am getting the below error.
403 Forbidden - Microsoft-Azure-Application-Gateway/v2
but when I am using another image it is uploading. and my API is returning success code(200).
what can be the root cause for this? why this particular image is not uploading to the blob storage container?
Thanks in advance!
CodePudding user response:
This error usually occurs when the Azure Application Gateway stops your request to upload that image.
Azure Application Gateway includes a firewall called Azure Web Application Firewall (WAF) that provides centralized protection of your web applications from common exploits and vulnerabilities.
While uploading that image to blob storage container, may be the Azure Web Application Firewall(WAF) is flagging that request as malicious. The image can also be malicious.
To confirm that, set the Web Application Firewall (WAF) in Application Gateway to Detection
mode and turn on the Diagnostic logs
. Go through those logs to identify the rule that is blocking the request.
You can avoid that error in 2 ways:
Go to Web Application Firewall (WAF) rules and disable the rule that is blocking the request.
Create a custom exception rule to allow that specific image.
Please check below references if they are helpful.
References:
Azure Application Gateway WAF tuning – Kloud Blog
c# - Error - 403 Forbidden - Microsoft-Azure-Application-Gateway/v2 - Stack Overflow