Hello @Tinu Thomas ,
Welcome to Microsoft Q&A Platform. Thank you for reaching out & hope you are doing well.
As per the Application gateway troubleshooting document,
Refer: https://learn.microsoft.com/en-us/azure/application-gateway/application-gateway-troubleshooting-502
502 error is not related to WAF. It could happen due to various reasons.
Could you please check the backend health of your Application gateway and share the details?
Also, could you please let me know if you are using HTTP or HTTPS? 502 errors can also occur due to Improper bundling of Certificates.
Refer: https://learn.microsoft.com/en-us/answers/questions/51336/appgateway-v2-certificate-issue
Few other steps that you could try:
- Stop and start Application Gateway.
- If you are using a custom domain to access the Azure Application gateway, make sure the backend App services are configured with the same custom domain as the hostname in the incoming request should match with the default domain or custom domain hosted in the backend.
https://learn.microsoft.com/en-us/azure/architecture/best-practices/host-name-preservation
Kindly let us know if the above helps or you need further assistance on this issue.
Please "Accept the answer" if the information helped you. This will help us and others in the community as well.