Received invalid status code: 403 in the backend server’s HTTP response for my app gateway

Santosh Pingali 0 Reputation points
2025-02-28T12:36:18.7933333+00:00

Im very new to azure app gateway im trying to replicate the same content which is showing for https://azdev8-dsm.testwd.com/Registration/Guest/Registration.htm it should show same when i access the https://azagw-dsm.testwd.com/Registration/Guest/Registration.htm .

so ,I have created backend pool as below IP address or FQDN : wd-az-asp-dev8-webservice.azurewebsites.net

User's imageUser's image

  • custom domain mapping to dedicated app gateway has already taken care by IT team.
  • Redirection rules:

User's image

My backend health shows as follows:

User's image

when i browse azagw-dsm.testwd.com/Registration/Guest/Registration.htm im getting as below

User's image

Note: Mistakenly I just removed the custom domain (azagw-dsm.testwd.com) from ** wd-az-asp-dev8-portal** . From that point im facing this error. Before that it was worked as expected.

Can any one help me on this pls

Thanks in advance

Santosh.Pingali

Azure Application Gateway
Azure Application Gateway
An Azure service that provides a platform-managed, scalable, and highly available application delivery controller as a service.
1,136 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Praveen Bandaru 700 Reputation points Microsoft External Staff
    2025-02-28T13:33:35.8333333+00:00

    Hello Santosh Pingali

    Greetings!
    I understand that you are receiving the 403-status code. However, when accessing the application gateway URL, you will encounter a 502 error.

    Based on your scenario, we observed that you are receiving a 502 error when trying to access the application gateway URL. From the health snapshot you provided, we understand that your backend is unhealthy, which is causing the 502 error.

    We also noticed that the backend web app URL "wd-az-asp-dev8-webservice.azurewebsites.net" is returning a 403 error for the application gateway request, marking the backend health as unhealthy.

    Could you please check if there are any network restrictions configured on the backend web app. If so, please allow the application gateway to reach the web app. This should result in a 200 response instead of 403, and the system will work as expected.

    And let me know (azagw-dsm.testwd.com) this belongs to which resource.

    Check the reference doc: Azure App Service access restrictions


    Hope the above answer helps! Please let us know do you have any further queries.

    Please do consider to “up-vote” wherever the information provided helps you, this can be beneficial to other community members.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.