Share via

Azure Application Gateway works from Azure VM but not from on-premises network

Henrique Faria 5 Reputation points
2025-12-19T09:59:34.8833333+00:00

Description

I am experiencing a connectivity issue with Azure Application Gateway (v2) publishing an internal application.

The application is accessible without issues when accessed from a virtual machine inside Azure, but fails when accessed from the on-premises network, even though the same DNS name is used in both scenarios.

Scenario

Azure Application Gateway is used as a reverse proxy for an internal application

Access works correctly from Azure

Access fails from the on-premises network

The same FQDN/DNS name is used from both locations

Architecture (simplified)

On-premises network connected to Azure via Site-to-Site VPN

Azure Application Gateway (v2) publishing the application

Backend: internal virtual machine

DNS resolves the application FQDN to the private IP address of the Application Gateway

Traffic is HTTPS (TCP 443) end-to-end

Observed behavior

From an Azure VM:

DNS resolves correctly to the private IP of the Application Gateway

HTTPS access works as expected

From the on-premises network:

DNS resolves to the same private IP of the Application Gateway

Browser fails to establish the connection

Goal

I would like to understand why traffic originating from Azure works correctly while traffic from the on-premises network does not, and which configuration might need adjustment.

Any guidance, troubleshooting steps, or best-practice recommendations would be greatly appreciated.

Azure Application Gateway
Azure Application Gateway

An Azure service that provides a platform-managed, scalable, and highly available application delivery controller as a service.

0 comments No comments

1 answer

Sort by: Most helpful
  1. Thanmayi Godithi 10,385 Reputation points Microsoft External Staff Moderator
    2025-12-19T10:23:16.8433333+00:00

    Hi @Henrique Faria,

    Thank you for reaching out on the Microsoft Q&A forum.

    Since the same FQDN resolves to the private IP of the Application Gateway and access works without issues from an Azure VM but fails from the on‑premises network, this points to a network connectivity or security configuration issue between on‑premises and the Application Gateway subnet. DNS resolution and the backend application itself are unlikely to be the cause.

    Below are the most common areas to review in this scenario:

    1. Application Gateway subnet NSG

    Even though traffic is coming over the VPN from on‑premises, it must still be explicitly allowed on the Application Gateway subnet.

    • Verify the NSG allows inbound TCP 443 from your on‑premises IP address ranges.
    • Check for any higher‑priority deny rules that might be blocking this traffic.

    https://learn.microsoft.com/azure/application-gateway/configuration-infrastructure#network-security-groups

    2. User‑Defined Routes (UDR) on the Application Gateway subnet

    If a UDR is associated with the Application Gateway subnet, ensure that:

    • Return traffic to on‑premises is routed via the VPN gateway
    • It is not sent to Internet or a firewall/NVA without symmetric routing, which can cause silent connection failures.

    https://learn.microsoft.com/azure/application-gateway/configuration-infrastructure#user-defined-routes

    3. VPN routing and address space propagation

    On the Site‑to‑Site VPN, please confirm that:

    • The Application Gateway subnet address range is included in the Local Network Gateway (on‑prem side)
    • The same address range appears in the effective routes within the Azure VNet
    • There is no CIDR overlap between on‑premises and Azure address spaces

    https://learn.microsoft.com/azure/vpn-gateway/vpn-gateway-about-vpngateways

    Why Azure access works

    Access from an Azure VM succeeds because the traffic stays entirely within Azure, bypassing VPN routing, on‑premises firewalls, and return‑path constraints that can affect on‑prem connectivity.

    Please let us know if the above helps or if you need any further assistance.
    If this answer was helpful,please 'Accept the answer' and kindly consider upvoting it. For any follow‑up questions, feel free to leave a comment.

    Was this answer helpful?


Your answer

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