Azure VNet Peering: Routing, DNS and Security Checks
Two Azure virtual networks can show a peering status of Connected while an application still cannot reach a service in the other network. Peering establishes a route between compatible address spaces; it does not guarantee that a DNS query resolves to the intended IP, that a network security group permits the connection or that a service listens on the expected port. A useful peering investigation therefore works outward from one specific failing flow.
Imagine an application subnet in VNet-A (10.10.0.0/16) calling a private API hosted in VNet-B (10.20.0.0/16) on TCP 443. Before changing anything, record the client VM or app identity, source and destination IP addresses, FQDN, port, resolved DNS answer, effective route and observed error. Each result rules out a different cause. The fact that a peering is Connected is only one result in that chain.
VNet peering allows resources in separate Azure VNets to communicate privately through Microsoft’s backbone network, subject to addressing, routing and security controls. The networks can belong to different subscriptions, and supported peering scenarios span regions; permissions are needed for the relevant VNets. Address ranges should not overlap. An overlapping prefix introduces ambiguity about the destination, and it should be resolved in the network design rather than hidden with a broad security rule.
Peering is configured as a relationship at both network ends. The settings governing virtual-network access, forwarded traffic and gateway use need to match the intended topology. A hub network connected to two spokes does not make those spokes automatically transitively reachable. If the design requires spoke-to-spoke traffic through an inspection appliance or another routing path, the engineer must configure and verify the relevant forwarding and routes rather than expecting peering to relay packets by default.
Azure chooses a route according to effective routes and route precedence. User-defined routes can steer traffic toward a network virtual appliance or a next hop instead of the system route introduced by peering. A routing mistake can send packets to a device that has no forwarding or return path. Before relaxing an NSG, check whether traffic is taking the expected next hop and whether the return flow has a valid route.
For VNet-A to VNet-B access, inspect the effective routes on the applicable network interface. If a route to 10.20.0.0/16 points toward an appliance rather than the expected peering route, determine whether that detour is deliberate. Trace both directions; a route that works outbound does not establish that responses return along an allowed path. Keep the troubleshooting question concrete: does a SYN packet have a route, a permitted filter decision and a service that can reply?
Network security groups apply prioritized allow and deny rules to subnet and network-interface traffic. An NSG rule that allows TCP 443 is not enough if the effective route sends the packet somewhere else. Equally, a valid route does not bypass an NSG deny rule. Evaluate the effective rules at the relevant source and destination boundaries, including port, protocol, source and destination prefixes and rule order.
One tempting but poor ‘fix’ is to allow all VNet-to-VNet traffic with a broad rule. That may turn a failed test green while unintentionally exposing management or database ports across application tiers. Start with the smallest required flow, test it, and expand only if the service contract requires more. Use Azure Network Watcher connection troubleshooting and IP flow verification where applicable as evidence, not as a substitute for examining the actual rules.
A service accessed through an Azure private endpoint needs the client to resolve the service name to the correct private endpoint address. Peering can provide network reachability to that address while DNS resolution still returns the service’s public endpoint. If public network access has been disabled, the application may report a service or authentication error that is really a name-resolution problem. The private DNS zone, its VNet links and any forwarding paths from custom DNS servers should be checked before the engineer changes a firewall.
From the actual client workload, query the complete service hostname and record the answer. Compare it with the expected private endpoint IP. Test direct IP reachability where it is meaningful, but do not treat a direct-IP success as proof that the application’s TLS hostname and DNS path are correct. Keep the FQDN as the application uses it; changing to a private IP literal can break certificates and application configuration.
Hub-and-spoke architecture is often used to centralize inspection, shared services or hybrid connectivity. A spoke can use a remote gateway in supported designs, and the hub may expose gateway transit; the relevant settings and routing must be deliberately configured. Peering alone is not a full site-to-site VPN or a general-purpose transit router. If traffic crosses on-premises networks, include the learned prefixes, effective return routes and security boundary in the test plan.
A peering link can be healthy even when a centralized security appliance drops the packet or advertises an incomplete route. Avoid blaming peering until you know where the traffic stopped. If you use a virtual network appliance, confirm that it is configured to forward the intended traffic, that routes direct both directions as designed, and that its own policy allows the specific workload flow.
Create two nonoverlapping VNets, one disposable VM in each, and a narrowly scoped peering relationship. First validate private-IP connectivity on a known listening port. Then intentionally deny that port in an NSG and observe the filtering result. Restore the rule and add a controlled user-defined route that changes the next hop. Record how the symptom differs from the NSG case, then remove the route to re-establish normal communication.
For a second drill, use a service with an authorized private endpoint and intentionally break or omit the correct private DNS link in the disposable environment. Compare its DNS answer before and after correction. The AZ-104 network fault lab covers broader DNS, NSG and route troubleshooting; the focus here is recognizing what the peering connection proves and what it cannot prove.
Keep the final network record intelligible. A useful closeout explains the intended source-to-destination flow, peering settings, address ranges, DNS resolution, effective routes, effective NSG rules, any gateway or appliance hops, and the observed application result. If a single configuration change fixed the issue, show why it fixed the correct boundary. The result should be a network design another administrator can operate—not merely a peering status that says Connected.