Access Web Page (hosted in VM) using Application Gateway's public IP

Zeeshan 6 Reputation points
2020-08-06T11:21:44.903+00:00

Hi,

I am facing some issues accessing my web page using application gateway's public IP.

My configuration is as below:

VNET:

FrontendSubnet -> associated with NSG (frontend)
- (frontend)NSG has rules:
-Destination Port: 9443
-Protocol: TCP
-Source: Any
-Destination: Any
- frontendSubnet is associated with VM
VM has application server deployed in it which I am able to access it using it's public IP on port 9443. i.e.:
https://<VM Public IP>:9443/

ApplicationGatwaySubnet:
-Appgw subnet has no any NSG
-Appgw has backend pool with targeting above VM (NIC (Private IP)
-HttpSetting is configured with port 9443 because I want to allow traffic on port 9443
-Listener is configured with Basic type.

Note: I am able to browse (access) web page (hosted in VM) using application gateway's private IP. i.e.:
https://<appgw's private ip>:9443/

Issue: I am not able to browse web page using Application Gateway's public IP

What I've done:

I've tried to create a rule in frontEnd NSG as below:
Destination Port: 9443
Protocol: TCP
Source IP: <Application Gateway public (frontend) IP>
Destination: <VM's private IP>,<VM's public IP>

What I followed:

I followed this document which is working fine for me because there is no NSG associated with backend subnet (in this document)
https://learn.microsoft.com/en-us/azure/application-gateway/quick-create-portal

What I am supposed to achieve:

I want to access my web application (hosted in VM) using Application Gateway's Public IP.

I've no further clue about how I can access web page using application gateway's public ip.

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
7,196 questions
Azure Virtual Network
Azure Virtual Network
An Azure networking service that is used to provision private networks and optionally to connect to on-premises datacenters.
2,178 questions
Azure Application Gateway
Azure Application Gateway
An Azure service that provides a platform-managed, scalable, and highly available application delivery controller as a service.
964 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. GitaraniSharma-MSFT 47,696 Reputation points Microsoft Employee
    2020-08-06T12:11:02.303+00:00

    Hello @Zeeshan ,

    What are the listener and rule configuration on the Application gateway?

    If you have a listener created for Private IP only, then you would not be able to access the Application gateway with the Public IP.
    The listener should have Public IP selected in the Frontend IP and it should be associated to a rule with the respective backend pool and HTTP settings.

    Kindly let us know if the above helps or you need further assistance on this issue.

    ----------------------------------------------------------------------------------------------------------------

    Please don’t forget to "Accept the answer" wherever the information provided helps you, this can be beneficial to other community members.