Your profile

One profile for every MSDEVBUILD site. Only you can see it, and the site owner if you write in.

Lesson 40 of 47
❮Prev Next❯

Troubleshoot Virtual Network Connectivity

Module 4: Networking ⏱ 11 min read Updated

Your note

My notes for this lesson

Select any text in the lesson to highlight it or add a note. Saved in this browser.

    No highlights yet. Select a sentence in the lesson, then pick a colour or add a note.

    All my bookmarks and notes

    Reading settings

    For every lesson, saved in this browser.

    Text size
    Line spacing
    Font

    With IaaS you rent the virtual machine. Microsoft looks after the building, power and hardware; you patch the operating system.

    30-second answer

    When VM A can't reach B, check in order: routing, then NSGs, then name resolution, then the app. Azure Network Watcher (enabled automatically per region) has a tool for each question. Connection troubleshoot tests A to B on a port and reports the failing hop. Next hop and the NIC's effective routes show where a packet goes (next hop None means it's dropped, often because peering isn't transitive). IP flow verify and effective security rules name the NSG rule that allows or denies a flow. Also check peering state (Connected), IP forwarding on NVAs, overlapping ranges and DNS.

    Simulate it » No Azure account needed

    Exam objective: 4.1.5 Troubleshoot network connectivity. (Skills measured as of April 17, 2026)

    Simulations

    Feel it before you read it. No account needed, nothing leaves this page.

    Azure portal: Troubleshoot connectivity with Network Watcher Use connection troubleshoot, next hop and IP flow verify.
    </> Embed

    Embed this simulation

    Free for trainers, teachers and bloggers. Paste this into your page:

    Loading the portal…

    App1 in spoke 1 can't reach app2 in spoke 2. Search for <strong>Network Watcher</strong>.

    👆 Click the glowing item in the portal to continue

    Read the steps as text
    1. App1 in spoke 1 can't reach app2 in spoke 2. Search for Network Watcher.
    2. Type network watcher in the search bar and pick Network Watcher under Services.
    3. Network Watcher is turned on automatically per region (in NetworkWatcherRG). Start with Connection troubleshoot.
    4. Unreachable, and the next hop is None: there's no route. That points at routing, not an NSG.
    5. Next hop confirms it. Spokes are peered with the hub, not with each other, and peering isn't transitive.
    6. Effective routes on the NIC shows why: 10.2.0.0/16 only matches the 10.0.0.0/8 None route. Add a UDR to the hub NVA (and one back from spoke 2).
    7. With the routes fixed, IP flow verify checks the NSGs on app2 for that exact flow. Allowed.
    8. Run Connection troubleshoot again: Reachable through the NVA. Order to remember: routes (next hop, effective routes), then NSGs (IP flow verify, effective rules), then the app.

    🧪 Simulation for learning. Screens are simplified versions of the Azure portal; names, prices and IDs are examples. Nothing here touches real Azure.

    😟 THE PROBLEM

    "The app can't reach the database" and three teams blame each other.

    😊 THE SOLUTION

    Use Network Watcher to test the path hop by hop and name the exact route or rule.

    • Is it routing?✓ Next hop and effective routes
    • Is it an NSG?✓ IP flow verify and effective rules
    • Where does it break?✓ Connection troubleshoot
    🛠️ Solved with: Network Watcher

    Start with a question

    Your parcel never arrived. Do you blame the courier, the address or the security guard?

    You check in order. Did it leave the depot and which van took it? Was the address right? Did the building’s security turn the driver away? Each question has someone who knows the answer, and guessing wastes a day.

    Network problems are the same. Routes decide which van, DNS decides the address and NSGs are the security guard. Azure Network Watcher gives you a tool for each, so you stop guessing and read the answer.

    Explain it like I’m 10

    The technical explanation

    Work through the layers

    QuestionToolWhat a bad answer looks like
    Can A reach B on port X at all?Connection troubleshoot (az network watcher test-connectivity)Unreachable, with the hop that failed
    Where does the packet go?Next hop (show-next-hop), Effective routes on the NICNone, Internet when you expected VirtualAppliance, a wrong appliance IP
    Which NSG rule decides?IP flow verify (test-ip-flow), Effective security rules, NSG diagnosticsDeny with the rule name, such as DenyAllInBound on the NIC NSG
    Does the name resolve right?nslookup from a VM in the VNetPublic IP for a private endpoint, NXDOMAIN for a private zone
    Is it the app?Packet capture, the VM’s own firewall and logsPort not listening

    Network Watcher is enabled automatically in each region where you have a VNet (resources live in NetworkWatcherRG). Most tools need the VM running and the Network Watcher agent extension for packet capture and connection troubleshoot. Monitoring tools such as Connection monitor and VNet flow logs belong to the monitoring domain; here we troubleshoot one problem at a time.

    Classic causes

    SymptomCauseFix
    Spoke 1 can’t reach spoke 2, next hop NonePeering isn’t transitivePeer them, or UDRs to a hub NVA on both sides
    Peering shows InitiatedOnly one side createdCreate the other link
    Peering won’t createOverlapping address spacesRe-address one VNet
    Packets die at the NVAIP forwarding off, or no return routeEnable IP forwarding (NIC and OS), add the mirror route
    NVA forwards into a spoke but it’s droppedPeering doesn’t allow forwarded trafficAllow forwarded traffic on the spoke’s peering
    Allowed on the subnet, still blockedNIC-level NSGFix or remove the NIC NSG
    Load balancer backend DownProbe blocked or wrong port/pathAllow AzureLoadBalancer, fix the probe
    Private endpoint ignoredNo privatelink DNS zone or VNet linkLink the zone, add a DNS zone group

    Portal and CLI

    Portal: Network Watcher → Network diagnostic tools → Connection troubleshoot / IP flow verify / Next hop / Effective security rules. On a NIC: Help → Effective routes and Effective security rules. From a VM: Help → Connection troubleshoot.

    az network watcher test-connectivity -g rg-net-hub --source-resource vm-app1 --dest-address 10.2.1.4 --dest-port 443
    az network watcher show-next-hop -g rg-net-hub --vm vm-app1 --source-ip 10.1.1.4 --dest-ip 10.2.1.4
    az network watcher test-ip-flow -g rg-net-hub --vm vm-app2 --direction Inbound --protocol TCP \
      --local 10.2.1.4:443 --remote 10.1.1.4:50000
    az network nic show-effective-route-table -g rg-net-hub -n nic-app1 -o table
    az network nic list-effective-nsg -g rg-net-hub -n nic-app2

    PowerShell: Test-AzNetworkWatcherConnectivity, Get-AzNetworkWatcherNextHop, Test-AzNetworkWatcherIPFlow, Get-AzEffectiveRouteTable.

    1. 1 Test

      Connection troubleshoot: Unreachable, next hop None.

    2. 2 Route

      Effective routes: 10.2.0.0/16 only matches 10.0.0.0/8 → None. Add UDRs to the hub NVA.

    3. 3 Forward

      Still failing at the NVA: turn on IP forwarding.

    4. 4 Rule

      IP flow verify on the target: AllowVnetInBound. Retest: Reachable.

    A troubleshooting session that ends well
    Architect level Why Cloud Shell can't test your VNet

    Cloud Shell runs in a Microsoft-managed container outside your VNet (unless you deploy it into a VNet), so nslookup or curl from it tests the public internet path, not what your VMs see. Network Watcher tools run from the VM’s NIC, which is why they give the real answer for private endpoints, private zones and UDRs.

    Real-world business scenario

    Wholesale

    Wide World Importers (fictional)

    The problem
    After a firewall migration, the order API in one spoke couldn't reach the inventory database in another. The app, database and network teams spent two days each proving it wasn't their fault.
    What they used
    A runbook built on Network Watcher: connection troubleshoot from the API VM, next hop, effective routes and IP flow verify. Next hop showed VirtualAppliance to the old firewall IP; the route table still pointed there.
    Why that choice
    Each tool answers one question with evidence, so the team found the stale route in ten minutes instead of arguing.
    The result
    The route was updated, connection troubleshoot showed Reachable, and the runbook is now the first step for every connectivity ticket.

    When to use it and when not to

    ✓ Use it when…

    • Any "can't connect" ticket between VMs, PaaS endpoints or on-premises.
    • Proving a route or NSG change worked before closing a change request.
    • Checking why a load balancer backend or private endpoint is ignored.

    ✕ Think twice when…

    • Testing VNet paths from Cloud Shell or your laptop.
    • Changing NSGs before you know routing is fine.
    • Using one-off tools for ongoing monitoring. Use Connection monitor for that.

    ↔ Alternatives to consider

    • Connection monitor for continuous reachability and latency tests with alerts.
    • VNet flow logs and Traffic analytics to see who talked to whom over time.
    • Azure Monitor Network Insights for a health view across network resources.
    Ready for more?The full lesson adds the technical explanation, when to use it, interview questions and revision notes.

    Test yourself with exercises

    5 original practice questions in the AZ-104 style. Pick your answers, then check them. You will see why each option is right or wrong. Score 75% or more and this topic is marked complete.

    Question 1

    Question 1 of 5

    You need to identify which network security group rule blocks inbound TCP 443 traffic from a specific internet IP address to VM1. Which Azure Network Watcher tool should you use?

    Question 2

    Question 2 of 5

    VM1 in Spoke1 cannot connect to VM2 in Spoke2. Both spokes are peered with a hub. Next hop for traffic from VM1 to VM2 returns None. What is the cause?

    Question 3

    Question 3 of 5

    You need to test whether VM1 can connect to sql1.contoso.com on TCP 1433, and if it cannot, identify the hop where the connection fails. Which tool should you use?

    Question 4

    Question 4 of 5 · Select 2

    Traffic from Subnet1 is routed to a network virtual appliance (NVA) by a user-defined route. Connection troubleshoot reports that traffic stops at the NVA. Which two configurations should you verify? Each correct answer presents part of the solution.

    Question 5

    Question 5 of 5

    You need to view all the routes, including system routes and user-defined routes, that apply to the network interface of VM1, and see which routes are not active. What should you use?

    Interview preparation

    Say your answer out loud first, then open the model answer. Interviewers care more about your reasoning than the exact words.

    Beginner A VM can't reach another VM. What's the first tool you'd use?

    Model answer

    Connection troubleshoot in Network Watcher. It tests the real path on the port I care about and tells me whether it's reachable, and if not, which hop failed, which points me at routes or NSGs.

    Intermediate What's the difference between IP flow verify and next hop?

    Model answer

    IP flow verify answers "is this flow allowed?" by checking NSG rules and naming the rule. Next hop answers "where does this packet go?" by checking routes and returning the next hop type, like VirtualAppliance, Internet or None. One is security, the other is routing.

    Experienced developer Next hop returns None between two spokes. What does that tell you?

    Model answer

    There's no route to the destination, so Azure drops the packet. Between spokes that are only peered to a hub, that's non-transitive peering. I'd either peer them directly or add UDRs on both spokes to a hub NVA, turn on IP forwarding on the NVA and allow forwarded traffic on the peerings.

    Scenario After adding a firewall in the hub, spoke VMs lost access to each other. Routes point at the firewall. Walk through your checks.

    Model answer

    Next hop from a spoke VM should say VirtualAppliance with the firewall IP. Then I check IP forwarding on the firewall's NIC if it's an NVA, the return route in the other spoke so traffic is symmetric, allow forwarded traffic on the spoke peerings, and the firewall's own rules. Connection troubleshoot then confirms which hop still fails.

    Quick revision

    Key points

    • Order - routes, NSGs, DNS, then the app.
    • Connection troubleshoot = end-to-end test with the failing hop.
    • Next hop / effective routes = where the packet goes. None = dropped.
    • IP flow verify / effective security rules = which NSG rule allows or denies.
    • Common causes - non-transitive peering, missing IP forwarding, one-sided peering, NIC NSG, missing private DNS link.

    Important terminology

    Azure Network Watcher
    A regional service with network diagnostic and monitoring tools, enabled automatically when you create a VNet in a region.
    IP flow verify
    Tests whether a single flow (protocol, local IP:port, remote IP:port, direction) to or from a VM is allowed, and names the NSG rule that decides.
    Next hop
    Shows the next hop type, next hop IP and route table for a packet from a VM to a destination IP.
    Connection troubleshoot
    Tests connectivity from a VM to another VM, IP or FQDN on a port and reports reachability, latency and the hop where it fails.
    Effective routes
    The combined system, BGP and user-defined routes applied to a NIC, with each route's state.
    NSG diagnostics
    A Network Watcher tool that evaluates NSG rules for a traffic pattern across the NSGs on its path.

    Common mistakes

    • Editing NSGs when the real problem is a route (next hop None).
    • Forgetting the return path through a stateful firewall.
    • Testing from Cloud Shell, which isn't inside your VNet.

    Exam tips

    • "Which NSG rule blocks the traffic?" = IP flow verify (or effective security rules).
    • "Is traffic sent to the NVA?" = Next hop.
    • "Test VM to FQDN on port 1433 and find the failing hop" = Connection troubleshoot.

    Five quick revision questions

    1. 1.Which tool names the NSG rule that denied a flow?Show

      IP flow verify.

    2. 2.What does next hop type None mean?Show

      The packet is dropped because no route sends it anywhere.

    3. 3.Where do you see all routes applied to a VM?Show

      Effective routes on its network interface.

    4. 4.Is Network Watcher enabled automatically?Show

      Yes, per region, in the NetworkWatcherRG resource group.

    5. 5.Which CLI command runs connection troubleshoot?Show

      az network watcher test-connectivity.

    Official references

    Finished this lesson? Tick it off. Your progress is saved in this browser.

    Next up: Azure Monitor Metrics and Diagnostic Settings

    Studying with a friend? Send them this lesson

    It's free and needs no sign-up. Their progress saves in their own browser.

    Lesson done? Make it stick with a quick gameSort It, Match the Pairs, Lightning Round and Who Am I? Earn XP and badges. Play ❯

    Install MSDEVBUILD Azure

    Free · no account · works offline

    Save the whole course for offline ›

    Hi, I’m your Nimbus

    Your study buddy. Pick what we do next.

    MSDEVBUILD · Multi-Stack Dev Build

    Sign in to MSDEVBUILD

    One account for Azure certifications and the blog: sign in here and you are signed in on both. Your XP, streak, practice deck and certificate stay in sync on every device. Optional: everything works without an account.