application gateway to webapp traffic

prasantc 976 Reputation points
2023-12-25T20:33:22.7933333+00:00

I have deployed an application gateway with required NSG and RT. When I am running health probe on application it shows successful.

I am trying to test web application traffic prior to DNS change by updating host file with web app DNS name and app gateway traffic public IP. But it is failing to browse "can't reach this page" while the test works if I use the web app internal IP on the host file. Is there any ways to test the application gateway route to web app is working properly beyond health probe test

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,219 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. GitaraniSharma-MSFT 50,106 Reputation points Microsoft Employee Moderator
    2023-12-27T10:24:40.36+00:00

    Hello @prasantc ,

    Welcome to Microsoft Q&A Platform. Thank you for reaching out & hope you are doing well.

    I understand that you would like to know how to test if the application gateway is routing the traffic to the backend web app properly.

    First of all, I would like to clarify the use of DNS change or host file entry usage for Application gateway.

    • If you are using a Basic listener and accessing your Application gateway using it's IP address, then you don't need to add any host file entry or make any DNS changes. You can access the application using the IP address directly and it should work as long as the backend is available and the probes are successful.
    • If you are using a multi-site listener with a hostname and accessing your Application gateway using that hostname, then you need to make DNS changes or add a host file entry pointing that hostname to your Application gateway's IP address.

    Refer: https://learn.microsoft.com/en-us/azure/application-gateway/create-multiple-sites-portal#edit-your-hosts-file-for-name-resolution

    Coming back to your question on how to test if the application gateway is routing the traffic to the backend web app properly, you can check this in 2 places:

    1. health probe test
    2. backend health of your Application gateway.

    When a backend server can receive traffic, the probe is successful and considered healthy. Otherwise, it's considered unhealthy. The precise representation of the health probes report is also made available for your consumption through the Backend Health capability.

    The Backend health report is updated based on the respective probe's refresh interval and doesn't depend on the moment of page refresh or Backend health API request.

    Refer: https://learn.microsoft.com/en-us/azure/application-gateway/application-gateway-backend-health

    https://learn.microsoft.com/en-us/azure/application-gateway/application-gateway-probe-overview

    Additional references for you:

    https://learn.microsoft.com/en-us/azure/application-gateway/how-application-gateway-works#how-an-application-gateway-routes-a-request

    https://learn.microsoft.com/en-us/azure/application-gateway/configure-web-app?tabs=defaultdomain%2Cazure-portal

    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.


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.