Understanding Azure Network Security
This lesson explains how traffic moves in a virtual network, and how the Azure network security services fit together.
Learning outcomes
After completing this lesson, you will be able to:
- Explain segmentation and blast radius.
- Distinguish routing from filtering.
- Compare the main network security services.
- Choose controls for each traffic direction.
The role of the network
Identity decides who can do something, and the network decides what can be reached from where. A Zero Trust design does not treat the network as a trusted zone, but network controls remain essential, because they restrict an attacker's movement. If a compromised web server can reach only one application port, then a database on another subnet is much harder to attack. This is known as segmentation, and it limits the blast radius of a breach.
By default, everything in a virtual network can talk to everything else in it, and that default is the main thing that a security engineer has to change.
How traffic moves in Azure
A virtual network is a private address space divided into subnets. Azure routes traffic between subnets automatically through system routes, and a user-defined route (UDR) overrides them, for instance to send traffic through a firewall. A route decides where a packet goes, and a filter decides whether it is allowed. Many network faults arise from confusing these two. A packet can be allowed by every rule and still never arrive because of a route.
Traffic has three broad directions, and each is addressed by different controls.
- Inbound from the internet, sometimes called north-south traffic: protected by Azure DDoS Protection, a WAF for web applications, and Azure Firewall.
- Between workloads, called east-west traffic: protected by NSGs and by Azure Firewall on a route between subnets or spokes.
- Outbound to the internet: controlled by Azure Firewall or a NAT gateway. Controlling this direction limits data exfiltration and communication with attacker servers.
Outbound access has also changed. For API versions released after 31 March 2026, new virtual networks default to private subnets, which have no default outbound internet access, so workloads must use an explicit method such as a NAT gateway. Existing virtual networks are not changed.
Routes and filters
Layering the controls
Each Azure network security service works at a different layer, and the exam expects candidates to choose among them. The following table compares the main services.
| Service | Layer and scope | Main purpose |
|---|---|---|
| Network security group | Layers 3 and 4, at a subnet or NIC | Filtering by address, port and protocol |
| Azure Virtual Network Manager | Layers 3 and 4, across many networks | Central rules that teams cannot override |
| Azure Firewall | Layers 3 to 7, central in a network | FQDN filtering, threat intelligence and, with Premium, IDPS |
| Web Application Firewall | Layer 7, on a web front end | Protection from web attacks such as SQL injection |
| Azure DDoS Protection | Layers 3 and 4, on public IP addresses | Mitigation of volumetric attacks |
| Private Link | Connectivity | Private access to PaaS services |
A hub-and-spoke design is common. Shared services, including Azure Firewall, sit in a central hub network, and workloads sit in spoke networks that are peered to it. UDRs on the spokes send traffic to the firewall, so that all traffic between spokes and to the internet passes one inspection point. NSGs are still applied in the spokes as a second layer.
The following diagram places the controls in a hub-and-spoke design.

Which network control?
Service tags and DDoS Protection
A service tag represents the IP address ranges of an Azure service, such as Storage, AzureLoadBalancer or Internet. Microsoft keeps them current, so rules do not need to track address changes. Some tags can be scoped by region, as in Storage.WestEurope.
All Azure public addresses receive basic infrastructure protection against distributed denial of service attacks. Azure DDoS Protection adds tuned mitigation, metrics, alerts and rapid response support, either per public IP address or across a virtual network. Web applications still need a WAF, since DDoS Protection deals with volumetric attacks at layers 3 and 4 and not with application attacks.
Tags and DDoS
Selecting a control for each path
A three-tier application has a public web tier, an application tier and a database tier. The web tier must be protected from SQL injection. The application tier must accept connections only from the web tier. Outbound traffic from all tiers must go only to approved FQDNs. Which control fits each requirement?
SQL injection is a layer 7 attack, so it needs a Web Application Firewall on Application Gateway or Front Door. Restricting the application tier to the web tier is a layer 4 rule, so it fits an NSG with application security groups. FQDN-based outbound filtering needs Azure Firewall with a UDR that sends outbound traffic through it, because NSGs cannot filter by FQDN.
A single control cannot do all of this, and it would be a mistake to look for one. Azure DDoS Protection addresses none of these three requirements.
Can an NSG allow traffic to www.contoso.com only?
Show answer
No. NSGs work on addresses and ports. FQDN filtering needs Azure Firewall.
Exam Tips
Remember for the exam
- Routes decide where a packet goes; rules decide whether it is allowed.
- NSGs cannot filter on FQDN; Azure Firewall can.
- DDoS Protection does not stop application attacks.
- Hub-and-spoke designs use UDRs to force traffic through a firewall.