You’re designing a new virtual network in Azure. You’re going to have three different security zones in your application. How many subnets do you need? I will help you understand why many of you gave the incorrect answer.
Back To Basics
In a previous post, I explained that virtual networks do not exist. Therefore, subnets do not exist. That’s why you cannot ping a default gateway. Packets do not leave a source NIC and route via default gateway to enter another subnet. Packets go from the source NIC, disappear in the physical network of Azure, and reappear at the destination NIC, whether it is on the same host, in the same data centre, in a neighbouring data centre, or on the other side of the world. Say it after me:
Subnets do not exist.
If packets go straight from source to destination, what is the logic of creating subnets to isolate resources?
Why Did We Segment Networks Using Subnets?
In the on-premises world, there are many reasons to segment a network. A common reason was to control the size of broadcast/multicast domains. That’s not an issue in Azure because virtual networks do not support broadcasts/multicasts.
From a security perspective, we segmented networks because we needed to isolate a firewall. The firewall is a central resource. A network runs from a top-of-rack switch to an ethernet interface in the firewall. That subnet uses the firewall to route to other subnets, possibly using the same cable (VLANs) or using different cables to other top-of-rack switches.
Earlier I asked you to imagine a workload with three security zones. Let’s call them:
- Web
- Application
- Database
That’s not too crazy. My security model requires me to ensure:
- Internet users can only reach the web servers on HTTPS
- The Application server can only be talked to by the web servers.
- The database servers can only be talked to by the application servers.
How would I create that? I’d set up three VLANs or subnets. Each VLAN would use a default gateway which is either the firewall or uses the firewall as a next hop to reach other VLANs. The firewall would then enforce my security intent, ensuring that only desired traffic could enter a VLAN to reach the required machines.

This design works perfectly well in on-premises cable-oriented networks because the networks (physical or virtual) are connected via cable(s) running to the firewall.
Bringing Cable-Oriented Designs To Azure
There is no finger-pointing here – I still have nightmares about an early Azure design I did where I created a VNet diagram with somewhere between 10-20 subnets. We all learn, and I’m hoping you learn from my mistakes.
Using the same requirements as before for our workload, we can produce the below design … based on cable-oriented patterns.

We create a single virtual network broken into 3 subnets. Each subnet has VMs for each role in the application. We then isolate each of the machines using NSGs.
That seems perfect, right? It is secure. Traffic will get from A to B. If we implement the rules correctly, then only the correct traffic will flow. But this design does display a lack of understanding.
Remember: packets go directly from source to destination. There is no default gateway. If an NSG that is processing rules on an Application Server NIC is allowing or denying traffic, then what is the point of the subnet? The subnet is not doing the segmentation; the NSG is doing the segmentation.
How Can We Segment Networks In Azure?
The most basic segmentation method in an Azure virtual network is the Network Security Group (NSG). While the previous Azure diagram is not technically wrong, the below diagram displays a better understanding of the underlying technology:

In this design, we are accepting that neither the virtual network nor the subnet exist. We are using rules in the NSG to isolate each tier of the application:
Look at the below NSG to see how this isolation can be done with a very simple example:

The NSG denies all traffic by default (rule 4000). Then the only traffic permitted is what we modeled previously using subnets. The rules are processed on the NICs, so the only way traffic enters a VM is if it is compliant with the above NSG.
Yes, I could use groups of IP addresses, or better, Application Security Groups that make the rules more readable and allow aggregation/abstraction of NICs & IP addresses.
So Why Do We Create Subnets In Azure
The primary reason is quite boring: technical requirements. Let me adjust my design a little. The database is going to be implemented using SQL Managed Instance instead of a VM. In the original VM-only design, there were no impediments to using a single subnet. SQL Managed Instance changes the technical requirements because it must be connected to a dedicated subnet.

That’s a simple example. A different example might be that I must use different address prefixes – see an older post by me on using a Linux VM as a NAT gateway where the VM has an internal NIC on a regularly addressed subnet and a second NIC in a subnet that is addressed based on NAT requirements.
Another example might be that you need to create custom routes for different NICs to the same prefix. For example, some NICs will go via your firewall to 0.0.0.0/0. Other NICs might go to “None” (a blackhole that drops packets) for traffic going to 0.0.0.0/0. The only way to implement that is to have one subnet for each Route Table. I’m not going to dive into routing here – let’s save that for another day.
Taking This Bigger
I am eventually going to explain enough things so I can show you why the classic Azure “big VNet” likely called production, test, or dev, is both an operational and security nightmare. But the above content, along with my other recent posts, are just part of the puzzle. Watch out for more content coming soon.
Enjoying the series thus far! Maybe this will be answered in your subsequent posts, but I had a few questions. Any thoughts on the below?
1) As mentioned isn’t there still management benefit to the proposed web, app, and DB subnet segmentation? Like being able to define NSGs to groups of IPs rather than specific IPs? Or are you saying ASGs are an alternative to dealing with subnets?
2) What about public vs. private subnets? Can you achieve the same security posture without segmenting into subnets? I guess you could try to use ASGs as well, but at least for outbound seems like subnets are easier to deal with
1) In theory, yes. But ASGs can be used with VMs and private endpoints. The counter is that the more subnets you create, the harder it will be for management to scale. Human errors will happen leading to a less dependable security model. See “manual patching”.
2) Subnets do not exist. Isolation inside the VNet has always been and always will be done by the NSG. You can give yourself piece of mind by creating loads of subnets for different zones, but in reality, there is no isolation by subnetting. The isolation is done by NSGs because under the covers, the entire VNet is a single mesh of NICs that can
route directly to each other
.
Thank you makes sense! On a slightly unrelated topic, I was having a conversation on another blog about the comparison between private endpoints and service endpoints and was trying to wrap my head around if it results in traffic being routed via the same network path. The link to the comment is below:
https://blog.cloudtrooper.net/2025/02/17/private-link-reality-bites-service-endpoints-vs-private-link/#comment-5023:~:text=I%20understand%20how%20Private%20Endpoints%20work%2C%20but%20I%E2%80%99m%20not%20entirely%20convinced%20that%20the%20actual%20network%20path%20for%20traffic%20using%20Service%20Endpoints%20versus%20Private%20Endpoints%20is%20truly%20identical.
Would you happen to have any input on the thread? It was originally spawned from some anecdotal evidence of private endpoints providing better performance than service endpoints.
Two things:
1) The author of that blog, Jose, is the best Microsoft-employed (or any) Azure networking person I know in the field. He has the benefit of being close with the teams and being in the field.
2) Service endpoints and private endpoints do use the same underlying channels. I don’t have inside knowledge of how things are coded, but I have heard and observed this.
This is helpful…thank you
I left to my last companie because Architects creates landing zones with huges vnets by bussines with mĂºltiples NSG and UDR (with n applications) instead to create application landing zones (small vnets dedicate to a one application). The hub always be a /21…..A Lot of discurssions about that way is not operable.
Good to see that I’m not a crazy boy.
Thanks for your post!