- A
User-defined routes never apply to peered networks.
Why wrong: User-defined routes do apply to traffic in a subnet, but they can lose to a more specific route for the destination prefix.
- B
The peering route is more specific than the default route, so it is selected first.
Azure uses the longest-prefix match first. The destination 10.2.2.7 falls within the peered VNet prefix 10.2.0.0/16, which is more specific than 0.0.0.0/0. A default route to a virtual appliance does not override a more specific route. To force traffic to the appliance, you need a matching UDR for the peered address range, not only a catch-all default route.
- C
NSG rules always override any route table entry.
Why wrong: NSGs filter traffic after routing decisions and do not determine the next hop. They cannot replace route selection behavior.
- D
Peering only works when both VNets are in the same region.
Why wrong: VNet peering can be global, so the region does not explain the route selection result shown by Network Watcher.
Quick Answer
The answer is that the peering route is selected because Azure applies the longest prefix match rule, and the peering route for 10.2.0.0/16 is more specific than the user-defined route for 0.0.0.0/0. When a VM sends traffic to 10.2.2.7, Azure evaluates all available routes—including user-defined routes, system routes, and peering routes—and chooses the route with the most specific prefix, meaning the one with the highest number of matching bits. In this case, the /16 peering route is a far more precise match than the catch-all /0 default route, so traffic is directed through VNet peering rather than the virtual appliance. On the AZ-104 exam, this scenario tests your understanding of route selection priority and the common trap that a user-defined default route does not override a more specific peering route. Remember the key rule: specificity always wins, regardless of route source. A helpful memory tip is “more bits, more rights”—the route with the longer prefix (more bits) always takes precedence.
AZ-104 Implement and Manage Virtual Networking Practice Question
This AZ-104 practice question tests your understanding of implement and manage virtual networking. Match the stated requirement to the specific cloud service, access model, or configuration option — many options are valid in isolation but not for this scenario. A key principle to apply: azure routing prioritizes the longest-prefix match for destination IP addresses.. Once you have made your selection, read the full explanation to reinforce the concept and understand why each distractor is designed to mislead on exam day.
A route table on a subnet contains this user-defined route: - 0.0.0.0/0 -> Virtual appliance 10.0.0.4 The subnet is peered to another VNet with address space 10.2.0.0/16. A VM in the subnet sends traffic to 10.2.2.7, and Network Watcher shows the next hop as Virtual network peering instead of the appliance. What explains this result?
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
The peering route is more specific than the default route, so it is selected first.
Azure uses the longest prefix match to determine the next hop for traffic. The user-defined route (UDR) for 0.0.0.0/0 is a default route, while the peering route for 10.2.0.0/16 is more specific. Since 10.2.2.7 falls within the 10.2.0.0/16 range, the peering route is preferred over the default route, directing traffic through the VNet peering instead of the virtual appliance.
Key principle: Azure routing prioritizes the longest-prefix match for destination IP addresses.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
User-defined routes never apply to peered networks.
Why it's wrong here
User-defined routes do apply to traffic in a subnet, but they can lose to a more specific route for the destination prefix.
- ✓
The peering route is more specific than the default route, so it is selected first.
Why this is correct
Azure uses the longest-prefix match first. The destination 10.2.2.7 falls within the peered VNet prefix 10.2.0.0/16, which is more specific than 0.0.0.0/0. A default route to a virtual appliance does not override a more specific route. To force traffic to the appliance, you need a matching UDR for the peered address range, not only a catch-all default route.
Related concept
Azure routing prioritizes the longest-prefix match for destination IP addresses.
- ✗
NSG rules always override any route table entry.
Why it's wrong here
NSGs filter traffic after routing decisions and do not determine the next hop. They cannot replace route selection behavior.
- ✗
Peering only works when both VNets are in the same region.
Why it's wrong here
VNet peering can be global, so the region does not explain the route selection result shown by Network Watcher.
Common exam traps
Common exam trap: answer the scenario, not the keyword
The trap here is that candidates assume a default route (0.0.0.0/0) always forces all internet-bound or cross-VNet traffic through a virtual appliance, forgetting that more specific routes—such as those from VNet peering—override the default route based on prefix length.
Trap categories for this question
Command / output trap
VNet peering can be global, so the region does not explain the route selection result shown by Network Watcher.
Detailed technical explanation
How to think about this question
Azure routing uses the system route for VNet peering, which is automatically added with an address prefix matching the peered VNet's address space. When a UDR for 0.0.0.0/0 exists, it only applies to traffic that does not have a more specific route; the peering route for 10.2.0.0/16 is more specific (longer prefix length of /16 vs /0), so it takes precedence. This behavior follows the principle of longest prefix match, which is fundamental to IP routing and is enforced by the Azure fabric controller.
KKey Concepts to Remember
- Azure routing prioritizes the longest-prefix match for destination IP addresses.
- System routes for peered VNets are automatically created and are more specific than 0.0.0.0/0.
- A 0.0.0.0/0 UDR acts as a default route for unmatched traffic.
- To override a system route for a peered VNet, a UDR with equal or greater specificity is required.
TExam Day Tips
- Watch for words such as best, first, most likely and least administrative effort.
- Review why wrong options are wrong, not only why the correct option is correct.
Key takeaway
Azure routing prioritizes the longest-prefix match for destination IP addresses.
Real-world example
How this comes up in practice
An e-commerce site experiences heavy traffic on Black Friday and near-zero traffic during off-peak weeks. Rather than provisioning permanent large VMs, the team uses auto-scaling groups that add capacity automatically under load and reduce it overnight. Questions like this test whether you understand elasticity, availability zones, and cloud compute scaling patterns.
What to study next
Got this wrong? Here's your next step.
Review azure routing prioritizes the longest-prefix match for destination IP addresses., then practise related AZ-104 questions on the same topic to reinforce the concept.
- →
Implement and Manage Virtual Networking — study guide chapter
Learn the concepts, then practise the questions
- →
Implement and Manage Virtual Networking practice questions
Targeted practice on this topic area only
- →
All AZ-104 questions
1,170 questions across all exam domains
- →
AZ-104 study guide
Full concept coverage aligned to exam objectives
- →
AZ-104 practice test guide
How to use practice tests most effectively before exam day
Related practice questions
Related AZ-104 practice-question pages
Use these pages to review the topic behind this question. This is how one missed question becomes focused revision.
Manage Azure Identities and Governance practice questions
Practise AZ-104 questions linked to Manage Azure Identities and Governance.
Implement and Manage Storage practice questions
Practise AZ-104 questions linked to Implement and Manage Storage.
Deploy and Manage Azure Compute practice questions
Practise AZ-104 questions linked to Deploy and Manage Azure Compute.
Implement and Manage Virtual Networking practice questions
Practise AZ-104 questions linked to Implement and Manage Virtual Networking.
Monitor and Maintain Azure Resources practice questions
Practise AZ-104 questions linked to Monitor and Maintain Azure Resources.
AZ-104 Azure RBAC practice questions
Practise AZ-104 questions linked to AZ-104 Azure RBAC.
AZ-104 storage account practice questions
Practise AZ-104 questions linked to AZ-104 storage account.
AZ-104 virtual network practice questions
Practise AZ-104 questions linked to AZ-104 virtual network.
AZ-104 NSG practice questions
Practise AZ-104 questions linked to AZ-104 NSG.
AZ-104 Azure Monitor practice questions
Practise AZ-104 questions linked to AZ-104 Azure Monitor.
AZ-104 backup practice questions
Practise AZ-104 questions linked to AZ-104 backup.
AZ-104 managed identity practice questions
Practise AZ-104 questions linked to AZ-104 managed identity.
Practice this exam
Start a free AZ-104 practice session
Short sessions build daily habit. Longer sessions build exam-day stamina. Try a timed session to simulate real conditions.
FAQ
Questions learners often ask
What does this AZ-104 question test?
Implement and Manage Virtual Networking — This question tests Implement and Manage Virtual Networking — Azure routing prioritizes the longest-prefix match for destination IP addresses..
What is the correct answer to this question?
The correct answer is: The peering route is more specific than the default route, so it is selected first. — Azure uses the longest prefix match to determine the next hop for traffic. The user-defined route (UDR) for 0.0.0.0/0 is a default route, while the peering route for 10.2.0.0/16 is more specific. Since 10.2.2.7 falls within the 10.2.0.0/16 range, the peering route is preferred over the default route, directing traffic through the VNet peering instead of the virtual appliance.
What should I do if I get this AZ-104 question wrong?
Review azure routing prioritizes the longest-prefix match for destination IP addresses., then practise related AZ-104 questions on the same topic to reinforce the concept.
What is the key concept behind this question?
Azure routing prioritizes the longest-prefix match for destination IP addresses.
About these practice questions
Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →
Same concept, more angles
2 more ways this is tested on AZ-104
These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.
Variation 1. A route table contains these entries: 10.0.0.0/8 with next hop Virtual appliance, and 10.1.1.0/24 with next hop Virtual network gateway. Which next hop will Azure use for traffic to 10.1.1.5?
medium- A.Virtual appliance, because the broader 10.0.0.0/8 route was created first.
- ✓ B.Virtual network gateway, because the /24 route is more specific than the /8 route.
- C.Internet, because Azure always prefers the default system route for public addresses.
- D.None, because Azure ignores overlapping route entries in the same table.
Why B: Azure uses the most specific route prefix (longest prefix match) to determine the next hop for traffic. For destination 10.1.1.5, the route 10.1.1.0/24 (prefix length 24) is more specific than 10.0.0.0/8 (prefix length 8), so the next hop Virtual network gateway is selected, regardless of the order in which routes were created.
Variation 2. A subnet has a user-defined route for 0.0.0.0/0 that sends traffic to a network virtual appliance at 10.1.0.4. The same virtual network is peered to a hub VNet that has a system route for 10.50.16.0/20. A VM in the subnet sends traffic to 10.50.18.25. Which next hop will Azure use?
hard- A.Internet, because the default route overrides more specific routes.
- B.Network virtual appliance at 10.1.0.4, because user-defined routes always win over system routes.
- ✓ C.Virtual network peering, because the /20 peering route is more specific than 0.0.0.0/0.
- D.None, because Azure disables routing when a subnet has both peering and a UDR.
Why C: Azure uses the most specific route (longest prefix match) to determine next hop. The destination 10.50.18.25 falls within the 10.50.16.0/20 range of the peering route, which is more specific than the 0.0.0.0/0 UDR. Therefore, the traffic is routed via the virtual network peering, not the NVA.
Keep practising
More AZ-104 practice questions
- A storage automation service principal must upload, read, and delete blob data in one container by using Microsoft Entra…
- A subnet contains several application servers. You need to allow inbound TCP 3389 only from a management subnet named Su…
- A subscription admin wants to investigate who changed a resource and also review the platform-generated events for that…
- Based on the exhibit, which Azure feature should the administrator use to track this kind of platform-wide service issue…
- An administrator wants a script running on an Azure VM to create a resource in Azure without storing any passwords or cl…
- A PowerShell script runs on an Azure VM every night and uses Azure CLI commands to create tags and VM resources in anoth…
Last reviewed: Jun 11, 2026
This AZ-104 practice question is part of Courseiva's free Microsoft certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the AZ-104 exam.
Question Discussion
Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.
Sign in to join the discussion.