Using NSGs to Isolate Tiers in a Multi-Tier Azure Application
You manage a multi-tier application in Azure with a web tier, application tier, and database tier. The web tier must be accessible from the internet, but the application and database tiers must only be accessible from the web tier. Which Azure networking feature should you use to isolate the tiers?
Quick Answer
The answer is to use network security groups (NSGs) on each subnet. This is correct because NSGs act as a stateful, built-in firewall that filters traffic at the subnet or NIC level, allowing you to define granular inbound and outbound security rules. By applying an NSG to the web tier subnet with an inbound rule allowing internet traffic on ports 80/443, and separate NSGs on the application and database subnets with rules that only permit traffic from the preceding tier’s subnet, you effectively isolate the multi-tier application NSG architecture without additional cost or complexity. On the AZ-500 exam, this scenario tests your understanding of network segmentation and least-privilege access—a common trap is choosing Azure Firewall for simple tier isolation, which is overkill and not cost-effective, or VNet peering, which connects networks but does not filter traffic. A useful memory tip: think of NSGs as “subnet bouncers” that only let in traffic from the tier directly above, keeping your database tier completely hidden from the internet.
⚠ Common exam trap
It's easy for candidates to confuse network segmentation (NSGs on subnets) with application-level grouping (ASGs) or perimeter security (Azure Firewall), and incorrectly assume that ASGs alone can provide isolation between tiers within the same subnet.
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
✓
Network security groups (NSGs) on each subnet.
Network security groups (NSGs) allow you to define inbound and outbound security rules that filter traffic at the subnet or NIC level. By placing each tier in its own subnet and applying an NSG to the web tier subnet that allows inbound traffic from the internet, and NSGs to the application and database tier subnets that only allow inbound traffic from the web tier subnet (using the source IP address range or the virtual network tag), you can effectively isolate the tiers while permitting necessary east-west traffic.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Virtual network peering between tiers.
Why it's wrong here
VNet peering connects networks but does not isolate; it would allow all traffic unless combined with NSGs.
- ✗
Azure Firewall with application rules.
Why it's wrong here
Azure Firewall with application rules filters outbound HTTP/S traffic based on FQDNs, but it does not enforce network-level isolation between tiers; the correct solution requires a virtual network service or subnet delegation that blocks all inbound traffic from the internet to the application and database tiers. This option is tempting because application rules are effective for controlling egress traffic in scenarios such as restricting which external websites a web server can access, but they cannot restrict ingress traffic between tiers within a virtual network.
- ✓
Network security groups (NSGs) on each subnet.
Why this is correct
NSGs allow you to define rules to permit or deny traffic between subnets, effectively isolating tiers.
- ✗
Application security groups (ASGs) within the same subnet.
Why it's wrong here
ASGs group VMs but do not inherently isolate traffic; they are used with NSG rules, not alone.
Visual reference
Go deeper
Related to this question
About these practice questions
One of 194 original AZ-500 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
Same concept, more angles
1 more way this is tested on AZ-500
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. You are designing a secure network architecture for a three-tier application. The web tier must be accessible from the internet, while the application and database tiers must only be accessible from the web tier. Which Azure service should you use to isolate the tiers most securely?
easy- A.Azure Firewall with application rules
- B.Azure Front Door with Web Application Firewall
- ✓ C.Network security groups (NSGs) on subnets
- D.VNet peering between tiers
Why C: Network security groups (NSGs) on subnets are the correct choice because they provide stateful, layer-3/layer-4 traffic filtering at the subnet level, allowing you to explicitly deny all inbound traffic to the application and database subnets except from the web tier's subnet or private IP range. This creates a micro-segmentation boundary that enforces the principle of least privilege without introducing additional latency or routing complexity.
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This AZ-500 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-500 exam.