@Anonymous Thank you for reaching out to Microsoft Q&A. I understand that you are having issues with accessing your application when it's behind the Application Gateway where it is throwing error 405 Not Allowed. Whereas accessing it directly does not cause any issue. Please correct me otherwise.
**405 Error- Method not allowed- The method received in the request-line is known by the origin server but not supported by the target resource. **
In order to troubleshoot this, I would start with looking at the Backend health logs to understand if the backend is throwing this error or the Application Gateway. Please go ahead and enable Backend access logs as per steps provided here. Once you have the same, please share it with us for further troubleshooting.
In the meanwhile, please refer to these Microsoft/3rd party sites that discuss why HTTP error 405 occurs and how to handle it:
- https://learn.microsoft.com/en-us/azure/application-gateway/application-gateway-backend-health-troubleshooting
- https://kinsta.com/blog/405-method-not-allowed-error/
- https://mkyong.com/servlet/http-status-405-http-method-get-is-not-supported-by-this-url-servlet/
Hope this helps. Please do let us know if you have any further questions in the meanwhile and we will be glad to assist. Thank you!
Remember:
Please accept an answer if correct. Original posters help the community find answers faster by identifying the correct answer. Here is how.
Want a reminder to come back and check responses? Here is how to subscribe to a notification.