Explorer
Explorer

Reputation: 421

Getting 403 Forbidden - Microsoft-Azure-Application-Gateway/v2 when trying to upload particular image to the Azure storage account

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!

Upvotes: 2

Views: 19111

Answers (2)

Bob
Bob

Reputation: 97

One simpler troubleshooting method is to attempt accessing the website that you're experiencing issues with using Chrome's Incognito mode.

If you can successfully access the website in Incognito mode, it indicates that the problem might be related to your browsing data. In that case, you can resolve the access issue on the normal Chrome browser by clearing your browsing data.

To clear your browsing data, follow the steps outlined in the link provided below:

Link to instructions on clearing browsing data in Chrome

By following these steps, you should be able to resolve the access issue and use the website normally (not needing Incognito).

Upvotes: -2

Sridevi
Sridevi

Reputation: 22397

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

How to Configure Application Gateway in Front of Azure Blob Storage - CHARBEL NEMNOM - MVP | MCT | CCSP - Cloud & CyberSecurity

c# - Error - 403 Forbidden - Microsoft-Azure-Application-Gateway/v2 - Stack Overflow

Upvotes: 3

Related Questions