AZ-104 Implement and Manage Virtual Networking Practice Question
A web workload in a subnet must use a NAT gateway for outbound internet traffic so the source IP is stable. The subnet currently has a route table with a 0.0.0.0/0 user-defined route to a virtual appliance. What should the administrator change?
⚠ Common exam trap
It's easy for candidates to think adding a NAT gateway automatically overrides existing UDRs, but in Azure, user-defined routes have higher priority than system routes (including those from NAT gateways), so the existing UDR must be explicitly removed or modified for the NAT gateway to handle outbound traffic.
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
✓
Remove or replace the 0.0.0.0/0 UDR to the virtual appliance and associate the NAT gateway with the subnet.
The current route table has a 0.0.0.0/0 user-defined route (UDR) pointing to a virtual appliance, which forces all outbound traffic through that appliance. To use a NAT gateway for outbound internet traffic with a stable source IP, the administrator must remove or replace that UDR (so the default route no longer points to the appliance) and associate the NAT gateway with the subnet. The NAT gateway automatically creates a default route (0.0.0.0/0) with a next hop of 'Internet', overriding the appliance route, ensuring traffic egresses via the NAT gateway's public IP.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Add an NSG outbound allow rule for TCP 80 and TCP 443.
Why it's wrong here
An NSG outbound allow rule for TCP 80 and TCP 443 only permits the traffic; it does not control the subnet's next-hop routing. The custom 0.0.0.0/0 route to the virtual appliance still overrides the default internet route, so the NAT gateway's public IP is never used. NSGs are stateful packet filters, not routers, so they cannot redirect traffic to the NAT gateway or alter the source IP for outbound connections.
When this WOULD be correct
In a scenario where the subnet has no UDR for 0.0.0.0/0 and the goal is to restrict outbound traffic to only HTTP/HTTPS, adding an NSG outbound allow rule for TCP 80 and 443 would be correct.
- ✓
Remove or replace the 0.0.0.0/0 UDR to the virtual appliance and associate the NAT gateway with the subnet.
Why this is correct
A NAT gateway provides stable outbound internet connectivity only when traffic follows the normal internet path from the subnet. The custom default route to a virtual appliance forces traffic away from that path, so the NAT gateway is bypassed. Removing or replacing the forced-tunnel route and then attaching the NAT gateway to the subnet allows outbound internet traffic to use the NAT gateway’s public IPs.
- ✗
Create a private endpoint for the web workload.
Why it's wrong here
A private endpoint assigns a private IP address for inbound access to an Azure PaaS service, making that service reachable from within the virtual network. This has no effect on the web workload's outbound internet traffic or the source IP visible to external destinations. The outbound path from the subnet is governed by routing and NAT configuration, not by private endpoints, which are designed to bring external services in, not to send local traffic out.
When this WOULD be correct
If the question asked how to securely connect an Azure web app to a storage account without exposing it to the public internet, creating a private endpoint for the storage account would be the correct answer.
- ✗
Enable VNet peering to a hub network with a firewall.
Why it's wrong here
VNet peering extends network connectivity between virtual networks, but it does not automatically associate a NAT gateway with the spoke subnet. If the hub's firewall is the next hop for internet traffic, outbound connections will use the firewall's public IP instead of the NAT gateway's IP, which defeats the requirement. To use a NAT gateway, you must attach it directly to the workload's subnet and ensure no forced-tunnel route (like the UDR to the firewall) reroutes 0.0.0.0/0.
When this WOULD be correct
In a scenario where an organization wants to centralize outbound traffic inspection and logging through a firewall in a hub network, while also requiring a stable source IP for specific workloads, enabling VNet peering to a hub network with a firewall would be correct. The firewall would then provide the stable source IP.
Option-by-option analysis
Why each answer is right or wrong
Understanding why wrong answers are wrong — and when they would be correct — is what separates a 750 score from a 900. The AZ-104 exam frequently reuses these exact scenarios with slightly different constraints.
✓Remove or replace the 0.0.0.0/0 UDR to the virtual appliance and associate the NAT gateway with the subnet.Correct answer▾
Why this is correct
A NAT gateway provides stable outbound internet connectivity only when traffic follows the normal internet path from the subnet. The custom default route to a virtual appliance forces traffic away from that path, so the NAT gateway is bypassed. Removing or replacing the forced-tunnel route and then attaching the NAT gateway to the subnet allows outbound internet traffic to use the NAT gateway’s public IPs.
✗Add an NSG outbound allow rule for TCP 80 and TCP 443.Wrong answer — click to see why▾
Why this is wrong here
An NSG outbound rule allows traffic but does not change the source IP to a stable public IP; the subnet still uses the UDR to the virtual appliance, so the NAT gateway is not used.
★ When this WOULD be the correct answer
In a scenario where the subnet has no UDR for 0.0.0.0/0 and the goal is to restrict outbound traffic to only HTTP/HTTPS, adding an NSG outbound allow rule for TCP 80 and 443 would be correct.
Why candidates choose this
Candidates may think that allowing outbound traffic via NSG is sufficient for internet access, overlooking that the UDR overrides the default route and prevents NAT gateway usage.
✗Create a private endpoint for the web workload.Wrong answer — click to see why▾
Why this is wrong here
A private endpoint is used to securely access Azure PaaS services over a private IP address, not to provide outbound internet traffic with a stable source IP. It does not replace the need for a NAT gateway or modify the subnet's default route.
★ When this WOULD be the correct answer
If the question asked how to securely connect an Azure web app to a storage account without exposing it to the public internet, creating a private endpoint for the storage account would be the correct answer.
Why candidates choose this
Candidates may confuse private endpoints with NAT gateways, thinking both provide outbound connectivity, or they may mistakenly believe that private endpoints can be used to route all outbound traffic.
✗Enable VNet peering to a hub network with a firewall.Wrong answer — click to see why▾
Why this is wrong here
Enabling VNet peering to a hub network with a firewall does not directly provide a stable source IP for outbound traffic from the web workload; it would route traffic through the firewall, which may change the source IP. The requirement is for a NAT gateway to ensure a stable source IP.
★ When this WOULD be the correct answer
In a scenario where an organization wants to centralize outbound traffic inspection and logging through a firewall in a hub network, while also requiring a stable source IP for specific workloads, enabling VNet peering to a hub network with a firewall would be correct. The firewall would then provide the stable source IP.
Why candidates choose this
Candidates may think that routing traffic through a hub firewall via VNet peering is a common pattern for controlling outbound traffic, and they might overlook the specific requirement for a stable source IP that a NAT gateway provides.
Analysis generated from the official AZ-104blueprint and verified against question context. The “when correct” sections are what AI assistants cite when candidates ask “what’s the difference between these options?”
Visual reference
Go deeper
Related to this question
Learn chapter
VPN Gateway and ExpressRoute
Key term
User-defined route
A user-defined route (UDR) is a custom routing rule you create in a cloud or on-premises network to override or supplement the system's default routing behavior, directing network traffic along a specific path.
Key term
UDR
UDR is a user-defined routing rule that controls how network traffic moves between subnets or to external destinations in a cloud or on-premises environment.
About these practice questions
This AZ-104 question is part of Courseiva's 1,049-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
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.