Deploy Azure Firewall in a hub-and-spoke topology and force all VM traffic through it, then debug why network rules alone can't filter HTTPS and fix it with application rules.
Adds to your resume: Deployed Azure Firewall in a hub-and-spoke network, forced all spoke VM traffic through it, and fixed HTTPS filtering by replacing network rules with application rules.
Securing an Azure Virtual Network is often handled with Network Security Groups alone IP and port-level rules attached per NIC or subnet. That works for basic segmentation, but it breaks down once an organization needs centralized, Layer 7-aware control over what leaves its network: FQDN-based filtering, threat intelligence, TLS inspection, or a single place to see and manage outbound policy across many spokes.
NSGs are stateless and scoped per resource. They can't inspect HTTPS traffic by destination domain, can't apply threat intelligence, and don't give a security team one pane of glass across a hub-and-spoke estate.
How do you centralize outbound and inter-subnet traffic inspection for an Azure network with Layer 7 FQDN filtering, logging, and a single enforcement point without relying on per-resource NSG rules that don't scale and can't see application-layer traffic?
| Aspect | Azure Firewall | Network Security Groups |
|---|---|---|
| OSI Layer | Layer 3–7 (stateful) | Layer 3–4 (stateless) |
| Scope | Protects entire subnets/networks | Protects individual NICs/subnets |
| State management | Maintains connection state | No state tracking |
| FQDN filtering | Full FQDN support with SNI | IP-based only |
| Threat intelligence | Built-in malware/botnet detection | None |
| Centralized management | Single pane via Firewall Manager | Individual rule management |
| Performance overhead | Single firewall instance for all traffic | Distributed, lower latency |
| Cost model | Pay for throughput | Pay per rule |
| Use case | Organization-wide security policy | Granular VM-level access control |
Key rule: NSG rules are evaluated after Azure Firewall. If Azure Firewall allows traffic but the NSG blocks it, the traffic is blocked both layers must permit it for traffic to pass.
Internet → Azure Firewall → NSG → Virtual MachineIf traffic is blocked at any layer, it terminates there.
Azure Firewall Basic - small-to-medium businesses, non-mission-critical workloads
Azure Firewall Standard - enterprise organizations, mission-critical workloads
Azure Firewall Premium - highly regulated industries, sensitive data
Design and implement a production-style hub-and-spoke network topology using:
This demonstrates controlled internet egress, centralized security inspection, and an enterprise routing pattern.


Note:
The AzureFirewallSubnet is a private subnet inside the VNet.
It gets:
Public connectivity comes via:

Why “Allow Forwarded Traffic”?
Because Azure Firewall will act as a routing appliance.
Without this, traffic redirection will fail.


At this point you'll see the VM has direct internet access to 0.0.0.0/0 Azure's default system route.

Azure Portal → Firewall
| Setting | Value |
|---|---|
| Name | hubfirewall |
| Region | East US |
| Availability Zone | None |
| Firewall SKU | Standard |
| Firewall Management | Use Firewall Policy |
| Firewall Management | Add new Firewall Policy |
| Virtual Network | hubvnet-firewall |
| Public IP | Create new PIP for the firewall |
NOTE: Standard SKU is used for this lab.

Go to routes on the created route table and add:
| Field | Value |
|---|---|
| Route Name | hubfw-route |
| Destination | 0.0.0.0/0 |
| Next Hop Type | Virtual Appliance |
| Next Hop Address | Firewall private IP |

Where to find the firewall's private IP: Azure Firewall → Overview → Private IP address (e.g. 10.0.0.4). Use that as the next hop.

You should now see 0.0.0.0/0 → Next Hop: Virtual Appliance (10.0.0.4), confirming traffic is forced through Azure Firewall.

If this doesn't show, your route table isn't properly associated.
At this point, SSH to the VM stops working. Traffic now flows VM → Firewall → Internet, but no firewall rule exists yet. Azure Firewall's default behavior is deny all outbound, deny all inbound.

A DNAT rule (Destination Network Address Translation) publishes an internal resource to the internet by translating a public IP/port to a private IP/port.
Azure Firewall → Firewall Policy → DNAT Rules:
| Field | Value |
|---|---|
| Rule Name | ssh-to-vm |
| Source Type | IP Address |
| Source | * (or restrict to your own public IP for production) |
| Destination Type | IP Address |
| Destination | Firewall public IP |
| Destination Port | 22 |
| Protocol | TCP |
| Translated Address | 10.1.1.4 (VM IP address) |
| Translated Port | 22 |
Once configured, you can SSH back into the VM but via the firewall's IP address.


Firewall Policy → Network Rules → Add Rule Collection:
| Field | Value |
|---|---|
| Name | allow-web-access |
| Type | Network |
| Priority | 130 |
| Action | Allow |
| Source | 10.1.0.4 (VM private IP) |
| Protocol | TCP |
| Ports | 80, 443, 8080 |
| Destination | * |
This allows raw TCP traffic. From the VM, ping 10.0.0.4 succeeds (firewall reachable), but curl https://www.google.com still fails.


Firewall Policy → Application Rules → Add Rule Collection:

| Field | Value |
|---|---|
| Name | apprule |
| Type | Application |
| Priority | 120 |
| Action | Allow |
| Source | * (or 10.1.1.4) |
| Protocol | HTTPS |
| Destination Type | FQDN |
| Target FQDN | google.com |
Test again from the VM:
bash
curl https://www.google.comThis now returns the full HTML response, confirming:

Azure Firewall processes rules in this order: DNAT → Network Rules → Application Rules. But HTTPS filtering by FQDN only works through Application Rules.
When the network rule used Destination: *, Port: 443, the firewall allowed TCP 443 traffic but performed no FQDN filtering it had no way to know which HTTPS destination was being reached. The Application Rule uses Layer 7 inspection: it matches the FQDN, applies proper outbound handling, and enables secure web filtering. Network rules work on IP and port; HTTPS filtering by domain requires Layer 7, which only Application Rules provide.
If curl fails:
This lab moved beyond basic firewall deployment into real-world operational validation not just standing up Azure Firewall, but proving traffic actually flows through it correctly, and diagnosing it when it doesn't.
ping and curl gives clear, distinct validation signals for different layersThis mirrors a pattern common in production environments: "ping works but HTTPS fails." Understanding the difference between L3/L4 and L7 inspection is what separates a cloud engineer who can deploy a firewall from one who can actually operate and troubleshoot it.
Azure Firewall is not just a routing appliance it's a security control plane.
Destination: * in production scope sources and destinations tightly| Priority | Recommendation | Benefit |
|---|---|---|
| High | Replace Source: * rules with scoped IPs/ranges | Removes an overly broad rule that was only used for lab testing |
| High | Send Firewall diagnostic logs to Log Analytics | Gives you a queryable audit trail instead of relying on the portal view |
| Medium | Add FQDN tags for known Azure service dependencies | Avoids manually maintaining long allow-lists |
| Medium | Evaluate Premium SKU if TLS inspection or IDPS becomes a requirement | Unlocks east-west TLS inspection and signature-based threat detection |
| Medium | Extend the hub-and-spoke pattern to additional spokes | Centralizes policy across more than one workload VNet |
| Low | Build a workbook combining Firewall logs and rule-hit metrics | One dashboard for ongoing policy review |
Sign in (free) to mark this lab complete, earn your first 50 XP and start a streak.
You just ran the full first lab end to end. The rest of the bundle unlocks when you enrol once - and every lab you finish earns XP and counts toward your ByteLabs certificate.
Get "Azure Operations Labs" · ₹767