Azure Firewall: The Guard at the Gate of Your Cloud Network
A complete, plain-English guide to network rules, application rules, threat intelligence, inspection of encrypted traffic, hub-and-spoke designs, logging, scaling and the mistakes that leave a cloud network exposed.
Think of a castle. It has high walls, but walls alone do not keep it safe. There is a gatehouse where guards check every person who enters or leaves. They read the list of who is allowed, turn away known troublemakers, and write every visit in a logbook. If a traveler claims to be a baker but carries a sword, the guards notice. Without the gatehouse, the walls are only a pile of stones.
A cloud network needs the same gatehouse. Azure Firewall is a managed security service that stands at the gate of your virtual network in Azure. It checks traffic going in, going out, and moving between your own systems, then allows or blocks it according to rules you write. In this guide you will learn what it is, how it works inside, how to place it in a design, how to write good rules, how to watch it, how to control its cost, and which mistakes to avoid.
1What Azure Firewall Is and Why It Exists
Start with the problem of an open network, then see how a firewall changes the picture.
The problem
When you build systems in the cloud, they talk to each other and to the outside world. A web server talks to a database. A database server might try to download updates. A developer laptop connects in from home. Every one of these conversations is a possible path for an attacker. If everything may talk to everything, one stolen password or one infected machine can spread through the whole network like water through a leaky ship.
What the service is
Azure Firewall is a managed, cloud-based network firewall. “Managed” means Microsoft runs and updates the machines behind it, so you do not patch or replace anything. “Firewall” means it sits on the path of traffic and decides, packet by packet or connection by connection, whether to allow or deny it. It is stateful, which means it remembers a conversation: if it allowed a request out, it knows the reply coming back is part of the same conversation and lets it through.
A building security desk keeps a clipboard. Visitors who signed in may leave again without a second check, and a delivery person who was sent for by a resident may come back with a signed receipt. The desk remembers context. A simple turnstile that only counts people does not. A stateful firewall is the desk with the clipboard.
What it gives you
Central rules
One place to say who may talk to whom, instead of scattered settings on many machines.
Rules by website name
Allow a server to reach only certain internet names, such as an update site, instead of the whole internet.
Threat feeds
Automatically deny traffic to and from addresses known to be malicious.
Deeper checks in higher tiers
Intrusion detection, inspection of encrypted traffic and web category filtering.
Built-in growth
It grows and shrinks with traffic without you adding machines.
Logs for everything
Every allow and deny can be recorded and searched.
2Background: How Firewalls Grew Up
Understanding the history of firewalls explains why the cloud version looks the way it does.
The first firewalls: packet filters
Early firewalls were simple. They looked at each small piece of data, called a packet, and checked a few facts on its label: where it came from, where it was going and which port number it used. A port is like a numbered door on a computer; web traffic uses one door, email another. A rule might say “allow door 80 to this server, deny all else.” These filters were fast but forgetful. They treated every packet alone, with no memory of the conversation.
Stateful firewalls
The next step added memory. The firewall tracked each connection, so it knew when a packet belonged to a conversation that was already allowed. This made rules shorter and safer, since you only had to describe who may start a conversation.
Application-aware firewalls
Then attackers started hiding bad behavior inside normal-looking doors. A web request on the web door could carry a harmful payload or head to a dangerous website. Newer firewalls learned to read the application conversation: which website name was requested, what kind of content it was and whether the traffic matched known attack patterns. The most advanced are sometimes called next-generation firewalls.
The move to the cloud
In an office, a firewall was a physical box in a rack at the edge of the network. In the cloud, there is no edge in that sense. Networks are software, created in seconds and changed constantly. Teams first ran firewall software on virtual machines, which meant patching, sizing and fixing them. Cloud providers then built managed firewalls to take that burden away.
| Generation | What it understands | Weakness |
|---|---|---|
| Packet filter | Addresses and ports of each packet | No memory of conversations |
| Stateful | Whole connections | Cannot read application content |
| Application-aware | Website names, protocols, content type | More work per connection |
| Next-generation | Attack signatures, user and content categories, encrypted content with inspection | Cost, tuning and privacy considerations |
The old idea of a perimeter
Traditionally, companies drew a line around their network. Inside was trusted, outside was not. In the cloud, this simple picture fades: staff work from everywhere, applications call each other across networks, and attackers who get inside move sideways. Modern security therefore also inspects traffic inside, between your own parts. This idea, often called zero trust, treats every connection as something to verify. A central firewall is one of the tools that makes this practical.
3Core Concepts: The Vocabulary of Azure Firewall
Each term below says what it is, why it exists, where it is used, a picture from daily life and an example.
Virtual network
Your private network in Azure, divided into smaller parts. Analogy: a campus with several buildings. Example: one network for a shop system.
Subnet
One slice of a virtual network with its own address range. Analogy: one floor of a building. The firewall needs a slice of its own with a required name.
Route table
A list that tells traffic which way to go next. Analogy: road signs. A route can say “send all internet-bound traffic to the firewall.”
Network rule
Allows or denies traffic by source address, destination address, port and protocol. Analogy: a guest list by street address.
Application rule
Allows or denies by the website name, such as a fully qualified domain name. Analogy: a guest list by name, not by street.
NAT rule
Translates an address, so outside users reach an inside server through the firewall’s public address. Analogy: a switchboard forwarding calls to an extension.
Rule collection
A named group of rules with a priority and an action. Analogy: a chapter in a rulebook.
Rule collection group
A container of collections that sets a higher level of ordering. Analogy: a volume holding chapters.
Firewall policy
A reusable object that holds rules and settings, which you can attach to many firewalls. Analogy: a company-wide rulebook with local appendices.
IP group
A named list of addresses used in rules. Analogy: a contact group in your phone.
Service tag and FQDN tag
Microsoft-maintained names for groups of addresses or website names, such as a service’s range. Analogy: a pre-made list that the publisher keeps current.
Threat intelligence
A feed of known malicious addresses and names that the firewall can alert on or deny. Analogy: a wanted-persons poster at the gate.
How the words fit together
Read it as a chain. A route table sends traffic from a subnet to the firewall. The firewall consults its policy, which contains rule collection groups, holding rule collections, holding individual rules. The first match decides, and the decision is written to a log. If you remember this chain, the portal and documentation make sense.
A rule can only act on traffic that actually reaches the firewall. Many first-time problems come from perfect rules and missing routes. Always ask two questions together: is the traffic sent to the firewall, and does a rule allow it?
4Architecture and Components
Here is where the firewall sits and what surrounds it in a typical design.
flowchart TD
NET["Internet"] FWPIP["Firewall public IP"]
subgraph HUB["Hub virtual network"]
FW["Azure Firewall in its own subnet"]
BAS["Management subnet for admin access"]
end
FWPIP FW
subgraph S1["Spoke 1 virtual network"]
A1["Web servers"]
end
subgraph S2["Spoke 2 virtual network"]
A2["Database servers"]
end
A1 FW
A2 FW
ONP["On-premises network"] |"VPN or private circuit"| FW
POL["Firewall policy"] -.-> FW
LOG["Log workspace"] -.-> FW
The firewall subnet
The firewall needs its own subnet with a specific required name, and no other resource may live there. Think of it as a guardhouse with its own plot of land. The subnet must be large enough for the firewall to grow, since it adds instances behind the scenes as traffic rises. Check the current minimum size in the documentation and choose comfortably above it.
Public and management addresses
The firewall has at least one public address, used for traffic going to the internet and for inbound translation. Some tiers and configurations also need an additional management subnet and address so Azure can control the firewall without using your data path. This is a detail to confirm for your chosen tier.
The hub
In a hub-and-spoke design, the hub is a central virtual network that holds shared services such as the firewall, connections to on-premises and sometimes name resolution. The spokes are separate networks for applications, each connected to the hub. This layout makes the firewall a single choke point where all important traffic must pass.
The policy
The firewall’s behavior lives in a policy. A policy can inherit from a parent policy, so a central security team defines company-wide rules, and application teams add their own rules below. This is the cloud version of a company rulebook with local appendices.
Supporting pieces
| Component | Role |
|---|---|
| Route tables | Steer traffic from spokes to the firewall |
| Virtual network peering | Connects the hub and spokes privately |
| Log Analytics workspace | Stores and searches firewall logs |
| Key Vault | Holds the certificate used when inspecting encrypted traffic in the premium tier |
| DNS | Resolves names; the firewall can act as a DNS proxy |
| Firewall Manager | Central management of policies across many firewalls and networks |
| Network security groups | Simpler subnet-level filters used alongside the firewall |
5Tiers: Basic, Standard and Premium
Azure Firewall comes in more than one tier. Each adds protection and cost, so choose by need.
| Capability | Basic | Standard | Premium |
|---|---|---|---|
| Network and application rules | Yes | Yes | Yes |
| Threat intelligence filtering | Alert mode | Alert and deny | Alert and deny |
| Website category filtering | Limited | Yes, by FQDN category | Yes, with more detail |
| Intrusion detection and prevention | No | No | Yes |
| Inspection of encrypted traffic | No | No | Yes |
| URL-level filtering | No | No | Yes |
| Intended scale | Small and medium business | Enterprise workloads | Highly regulated or sensitive workloads |
This table is a simplified picture. Exact features, limits and names change, so confirm the current comparison on the official page before you decide.
Basic
Meant for smaller environments with moderate traffic. It gives essential filtering at a lower price, with fixed throughput limits lower than other tiers. Good for a small company that needs a managed gatekeeper but not deep inspection.
Standard
The common choice for production. It adds full threat intelligence, filtering by categories of websites, more rule capacity and automatic scaling to high throughput.
Premium
For sensitive and regulated systems. It adds a system that watches for signatures of known attacks, can look inside encrypted web traffic after decrypting it with a certificate you provide, and filters at the level of the full web address, not only the website name.
Basic is a guard who checks your name against a list. Standard is a guard who also knows banned people and can tell which shop you plan to visit. Premium is a guard who also opens your bag, with your permission, to see if anything dangerous is inside.
Choosing a tier
Start with the questions: Is there regulation requiring intrusion detection or inspection of encrypted traffic? How much throughput do you expect? How many rules and networks? Do you need to filter by full address? If you answer “no” to the heavy features, Standard is usually enough. Premium is worth it when the data is valuable or rules demand it. Switching tiers later is possible but should be planned and tested.
6Internal Working: How Traffic Is Judged
Follow one connection from a server to the internet and see every decision on the way.
sequenceDiagram participant VM as Spoke server participant UDR as Route table participant FW as Azure Firewall participant TI as Threat intelligence participant NET as Internet site VM->>UDR: Send packet to a website UDR-->>VM: Next hop is the firewall VM->>FW: Packet arrives FW->>TI: Is destination known bad? TI-->>FW: No FW->>FW: Check NAT, then network, then application rules FW->>FW: Rule matches, action is allow FW->>NET: Forward with the firewall public address NET-->>FW: Reply FW->>FW: Match reply to remembered connection FW-->>VM: Deliver reply FW->>FW: Write log entry
Step by step
The route sends traffic to the firewall
A route table on the server’s subnet says the next stop for internet traffic is the firewall’s private address.
Threat intelligence check
If the feature is on, the firewall compares the destination with its list of known malicious addresses and names. A hit is alerted or denied before any rule is read.
Rules are evaluated in order
Translation rules come first, then network rules, then application rules. Within each type, collections are read by priority number, lowest first. The first match wins.
Default is deny
If nothing matches, the traffic is denied. This default is the heart of a safe design: only what you explicitly allow can pass.
The connection is remembered
An allowed connection is placed in a state table, so replies are recognized and allowed without checking all rules again.
Address translation
For outbound traffic to the internet, the firewall replaces the private source address with its own public one, so replies find their way back.
Logging
The decision and its details are written to the log stream you configured.
Network rules versus application rules
Network rules work on addresses and ports and are evaluated first. Application rules understand the name in a web request or in the secure handshake, so they can say “allow this server to reach the update site on the secure web door.” Because application rules look at names, they are more precise for internet destinations, whose addresses may change without notice.
What about the premium extras
In premium, an additional engine inspects traffic for patterns of known attacks and can drop matching connections. If encrypted inspection is enabled, the firewall acts like a trusted middleman: it ends the encrypted conversation, reads the content, and starts a new one toward the real destination. Clients must trust the certificate the firewall uses for this. A later chapter covers the benefits and cautions.
7Rules in Depth: Network, Application and NAT
Rules are the heart of the firewall. Writing them well is the difference between a safe network and a false sense of safety.
Network rules
A network rule names a source, a destination, a protocol and a port. Sources and destinations can be single addresses, ranges, IP groups, service tags or, in some cases, names. Example: allow the application subnet to reach the database subnet on the database port. Network rules suit traffic between your own networks, traffic to on-premises, and non-web traffic such as time synchronization or remote login.
Application rules
An application rule names the source, the protocol (such as the secure web protocol) and the destination website names. Wildcards are allowed at the start of a name, such as every host under one company domain. Premium adds filtering by full web address and by web categories like gambling or social media. Use these for outbound web access, so a server can reach only the update site and the monitoring site it needs.
NAT rules
A NAT rule, also called a destination translation rule, takes traffic arriving at the firewall’s public address and port and forwards it to a private server and port. It is useful for exposing a service without giving the server its own public address. Use it sparingly and prefer a web gateway for public web applications, since the firewall is not a web application firewall.
Rule order
| Level | Evaluated | How it is ordered |
|---|---|---|
| Rule collection group | First, by its own priority | Lower number first |
| NAT collections | Before network and application collections within the policy | By collection priority |
| Network collections | Then network rules | By collection priority |
| Application collections | Last | By collection priority |
| Default | If nothing matches | Deny |
When a network rule allows traffic, application rules for the same traffic are not consulted. When a network rule denies it, the deny stands. This detail surprises many people: a broad network rule can silently override a careful application rule.
Writing good rules
Be specific
Name exact sources and destinations. Avoid “any to any” except as a temporary test.
Use groups
Collect addresses into IP groups with clear names, so a change happens in one place.
Name by purpose
Rule names should say why they exist, such as “web tier to database tier”.
Add an owner and a date
Use descriptions or tags to record who requested the rule and when it should be reviewed.
Review regularly
Remove rules with no hits for months, since old rules are quiet doors left open.
Leave gaps in priority numbers
Use steps of 100 so you can insert collections later without renumbering.
The firewall controls where traffic may go. It does not understand your application’s logic. Public web applications still need a web application firewall and secure code.
8Policies, Inheritance and Central Management
When you have more than one firewall, managing each separately becomes a chore and a risk. Policies solve this.
What a policy contains
A firewall policy stores the rule collection groups, the threat intelligence mode, DNS settings, and in premium the intrusion detection mode and the certificate for encrypted inspection. You attach a policy to one or several firewalls. Updating the policy updates all firewalls using it.
Parent and child
A child policy inherits everything from its parent and can add its own rules. Rules in the parent are evaluated first and cannot be removed by the child. This allows the central security team to say “these destinations are always blocked” and “these services are always allowed,” while application teams add what they need.
flowchart TD P["Company base policy: global blocks and shared allows"] --> R1["Region A policy"] P --> R2["Region B policy"] R1 --> F1["Firewall in Region A hub"] R2 --> F2["Firewall in Region B hub"] R1 --> F3["Firewall in Region A test hub"]
Firewall Manager
Azure Firewall Manager is a central console for creating policies, attaching them to firewalls and managing security across many virtual networks and subscriptions. It also supports secured virtual hubs, which are Microsoft-managed hubs that include a firewall, simplifying routing in large designs.
Who may change what
Use role-based access control to separate duties. A small security team may edit the base policy. Application teams may edit only their own child policy. Auditors can read everything but change nothing. Every change should go through review, since a single wrong rule can open the network or cut off a service.
Infrastructure as code
Describe policies in template files stored in version control. Reviewers can see exactly what changes, test environments can be created from the same files, and a bad change can be reverted quickly. Clicking in the portal leaves no trail and invites drift between environments.
Limits to keep in mind
There are limits on the number of rules, collections and groups per policy, and on how many IP addresses can be used in rules. Large estates should check the current limits and design around them, for example by using IP groups and service tags to keep rule counts down.
A franchise restaurant chain has a company manual that every branch must follow, plus a local page for each branch. The head office can change the main manual once, and every branch gets the update. That is a parent policy with child policies.
9Routing: Sending Traffic Through the Firewall
A firewall only guards traffic that passes through it. Routing is how you make sure that happens.
User-defined routes
Azure creates default routes for each subnet. To send traffic through the firewall, you create your own route table with a route that matches all destinations, written as 0.0.0.0/0, and set the next stop to the firewall’s private address. You then attach the table to the spoke subnets. From then on, traffic leaving those subnets for the internet reaches the firewall first.
Spoke to spoke traffic
By default, two spokes connected to the same hub cannot talk to each other. They are not directly connected. To let them communicate, routes in each spoke send the other spoke’s address range to the firewall, which then decides whether to allow it. Now the firewall can inspect and log east-west traffic, meaning traffic that moves sideways inside your network.
On-premises traffic
Traffic from your offices arrives through a VPN or private circuit into the hub. To inspect it, route it through the firewall as well, using routes on the gateway subnet. Traffic back to on-premises from spokes goes to the firewall first, then onward.
Asymmetric routing
A connection must travel through the same firewall in both directions. If the request goes through the firewall but the reply takes another path, the firewall sees only half the conversation, treats the reply as unknown and drops it. This is called asymmetric routing, and it causes some of the most confusing faults. The fix is to review routes on both ends so all paths agree.
flowchart LR A["Spoke 1 server"] -->|"route to firewall"| F["Firewall"] F -->|"allowed"| B["Spoke 2 server"] B -->|"reply must return the same way"| F F --> A B -. "direct reply path would break it" .-> A
Forced tunneling
Some organizations want all internet traffic to go through their own network first, for example through a corporate proxy. The firewall supports a forced tunneling mode where internet-bound traffic is passed onward to another device. It needs an extra management subnet so Azure can still reach the firewall. This setup adds complexity; use it only when required.
Routes learned automatically
Gateways can advertise routes learned from on-premises, and these may compete with your custom routes. If an automatically learned route is more specific than your default route, it wins. Check effective routes for a network interface when behavior surprises you. Most guides recommend disabling propagation of gateway routes on spoke route tables so that your own routes stay in charge.
When traffic does not go where you expect, inspect the effective route list of the sending machine. It shows the final result after all route sources are merged and ends many arguments quickly.
10Hub-and-Spoke and Other Network Designs
Where you place the firewall shapes everything else. A few well-known layouts cover most needs.
| Design | Idea | Best for | Watch out for |
|---|---|---|---|
| Single network | One virtual network with the firewall in its own subnet | Small projects | Hard to grow and to separate teams |
| Hub-and-spoke | Firewall in a shared hub; applications in spokes | Most companies | Hub becomes critical; plan capacity and access |
| Secured virtual hub | Microsoft-managed hub with built-in firewall | Large, many-branch estates | Fewer customization options |
| Per-application firewall | Each app has its own firewall | Strong isolation needs | Higher cost and more to manage |
| Multi-region hubs | A hub per region, linked together | Global or resilient systems | Routing between hubs must be designed with care |
Why hub-and-spoke is popular
It centralizes expensive and sensitive services in one place while keeping applications in neat separate spokes. A new application team gets a spoke and a route table, and automatically inherits the company’s baseline rules. The firewall’s cost is shared across all applications.
Layering with other protections
Network security groups
Simple allow or deny filters on each subnet or interface. They give fast local protection and a second line of defense if the firewall rule is wrong.
Web application firewall
Placed in front of public web applications to catch attacks that the network firewall cannot understand.
DDoS protection
Absorbs large floods aimed at public addresses.
Private endpoints
Reach platform services over private addresses so traffic never uses the public internet.
Identity controls
Strong sign-in and least privilege for the people and programs that use the network.
Endpoint protection
Security software on the servers themselves, for what the network cannot see.
Where public web traffic fits
A common design puts a web application gateway with a firewall feature at the front for incoming web traffic, while Azure Firewall guards outbound traffic and traffic between networks. Each does what it is best at. The two can be arranged in series or in parallel, and the choice depends on where you need to inspect and which addresses your servers see.
A hotel has a reception desk for guests, key cards for each room and cameras in the corridors. No single measure is enough. Together they make the building safe, and a failure of one does not empty the whole place.
11Threat Intelligence, IDPS and Encrypted Traffic Inspection
The advanced protections go beyond simple allow and deny lists. Understand what each one does and what it costs.
Threat intelligence
Microsoft maintains feeds of addresses, names and web addresses known to be linked to malware, scanning and other harm. The firewall can compare traffic with these feeds. In alert mode, it only writes a log entry. In alert and deny mode, it blocks the traffic as well. Start with alert if you are worried about false matches, then move to deny after reviewing a period of logs. Feeds change often, so you gain protection without writing new rules.
Intrusion detection and prevention
In the premium tier, a signature-based engine looks for patterns that match known attacks across many categories. Signatures are updated regularly. Modes include off, alert only, and alert and deny. You can override a signature, such as turning off a noisy one for a specific source, or setting different handling by category. Signature checking costs processing power, which is why throughput limits are lower with this feature on than with simple rules alone.
Inspecting encrypted traffic
Most web traffic is encrypted, so a firewall that cannot see inside misses most of what is happening. In the premium tier, the firewall can decrypt outbound web traffic, inspect it, then re-encrypt it. For this to work, you give the firewall an intermediate certificate from your own certificate authority, stored in Key Vault, and make every client machine trust that authority.
Decrypting traffic means reading private content. Exclude categories such as banking and health portals unless rules and law say otherwise, tell users about the practice, and protect the certificate with great care. Some applications refuse to work through a decrypting middleman, and need exceptions.
Limits of encrypted inspection
The feature applies to outbound traffic and traffic between your own networks. Inspection of inbound encrypted traffic to public web applications is handled by a web application gateway at the front. Pinned certificates, client certificates and some protocols cannot be decrypted. Always test with your applications before enforcing.
URL and category filtering
Standard allows filtering by website name and category. Premium also reads the full web address of decrypted requests. This helps allow one folder of a site while blocking another, though only if decryption is used for that traffic.
| Protection | What it catches | Main trade-off |
|---|---|---|
| Threat intelligence | Traffic to or from known bad places | Occasional false matches |
| Intrusion detection and prevention | Known attack patterns in traffic | Processing cost; tuning needed |
| Encrypted traffic inspection | Threats hidden inside secure connections | Privacy, certificates and compatibility |
| Category filtering | Access to unwanted kinds of websites | Classification can be imperfect |
12DNS, Addresses and Outbound Connectivity
Names and addresses are the plumbing under every rule. When they go wrong, everything looks broken.
DNS proxy
DNS turns a name into an address. When the firewall is set as a DNS proxy, servers send their name questions to the firewall, which forwards them to a name server and returns the answers. This matters for rules that use names: the firewall must resolve a name to the same address that the server resolves, or the rule may not match. Using one resolver for both avoids such gaps. It also gives you a log of every name asked, which is valuable for spotting suspicious activity.
Outbound address and port exhaustion
When many servers go to the internet through one public address, the firewall must tell connections apart by using different source port numbers. Each public address offers a limited number of ports for a given destination. A busy system opening very many connections to the same destination can run out, and new connections fail. The remedy is to add more public addresses or use a NAT gateway with the firewall subnet, which offers many more ports. Plan this in advance for heavy outbound workloads.
A company has one phone number and many extensions. Each outgoing call needs a free line. When all lines are busy, the next caller gets a busy signal. Adding more phone numbers adds lines.
Known destinations your servers need
Servers often quietly need access to platform services: operating system updates, time synchronization, monitoring agents and license servers. Block everything, and these silently fail. Microsoft publishes tags that group these destinations so you can allow them without chasing addresses. Use FQDN tags and service tags where possible; they update automatically.
Private access to platform services
Instead of sending storage or database traffic across the internet, you can give those services private addresses inside your network using private endpoints. The traffic stays on the private network and the firewall can inspect it. Consider that private endpoint traffic may need special route settings to flow through the firewall, so verify the behavior in your design.
IPv6 and other protocols
Check whether your tier and region support the address types and protocols you need. Do not assume that all features of one protocol family work for another.
Fixed outbound address
Partners may want to allow your traffic by address. The firewall’s public address gives a stable outbound identity.
Multiple public addresses
Add several to increase port capacity and to separate traffic for different partners.
Name resolution tests
From a spoke server, resolve a name and compare it with what the firewall resolves.
13Security of the Firewall Itself
The guard at the gate must also be guarded. Whoever controls the firewall controls the network.
Who may change it
Use role-based access control with the smallest roles that work. Separate the right to read from the right to write. Consider requiring approval for changes to the base policy, and use privileged access features so powerful roles are active only for a short time when needed. Every rule change is an audit event; send these events to a protected log store that the changers cannot edit.
Protecting secrets
The certificate used for encrypted traffic inspection is extremely sensitive: anyone holding it could impersonate sites to your users. Store it in Key Vault with tight access, use a managed identity for the firewall, rotate it on schedule and monitor its use. Never email or store it in shared folders.
Avoiding over-broad rules
The most common weakness is not a software bug but a rule that is too wide. A rule that allows all ports from all internal addresses to anywhere defeats the firewall. Review rules for words like “any” and for large address ranges. Tools that analyze rule hits and suggest tighter rules can help.
Defense in depth
Do not make the firewall your only protection. Add subnet filters, server hardening, strong identity, patching and monitoring. If an attacker slips past one layer, others should still stand. A good test is to ask: if this firewall rule were wrong, what else would stop an attacker?
Protecting management paths
Administrators need to reach servers, but exposing remote login ports to the internet is risky. Use a managed bastion service or just-in-time access that opens a port only for a short time and for a named person. The firewall can then allow remote login only from the bastion subnet.
Compliance and evidence
Regulated organizations must show that controls exist and work. Keep records of rule approvals, regular rule reviews, log retention and test results. Firewall logs, policy history and activity logs together tell a clear story to an auditor.
| Risk | Control |
|---|---|
| Unauthorized rule changes | Role-based access, approvals, activity log alerts |
| Over-broad allow rules | Regular reviews, rule hit analysis, least privilege design |
| Stolen inspection certificate | Key Vault, managed identity, rotation, monitoring |
| Open remote login ports | Bastion or just-in-time access |
| Logs tampered with | Send logs to a protected workspace with limited write rights |
| Single layer reliance | Network security groups, server hardening, identity controls |
14Scaling, Performance and Capacity
A firewall that cannot keep up becomes a traffic jam at the gate. Know how it grows.
Automatic scaling
Behind the single name, Azure Firewall runs several instances. When traffic or the number of connections rises, new instances are added; when it falls, they are removed. You do not pick a size. The tier sets the upper limit of throughput, and the actual speed depends on what features are on. Simple rules are fastest; intrusion prevention and encrypted inspection cost more processing and lower the ceiling.
Scaling takes time
Adding instances takes minutes. A sudden, enormous burst can arrive faster than scale-out. If you expect a known event, such as a big batch job or a migration, consider the effect in advance and test it. Watch the throughput and the health metrics during growth.
A worked example
These numbers are illustrative and are not official limits. Suppose a company has 40 servers and each moves about 50 megabits per second at busy times, but not all at once. If 60 percent are busy together, the peak is 40 times 0.6 times 50, which is 1,200 megabits per second, or about 1.2 gigabits per second. If your chosen tier and feature mix comfortably handle, say, 5 gigabits per second, there is room to grow. If you turn on intrusion prevention and the practical ceiling drops to 1 gigabit per second, you would exceed it and should choose another approach, such as splitting traffic across firewalls or excluding trusted internal flows from deep inspection. Always check real limits for your tier on the official pages.
Factors that reduce throughput
Deep inspection
Signature checks need more work per packet.
Encrypted inspection
Decrypting and re-encrypting uses significant processing.
Many small connections
Short, frequent connections strain connection tracking more than a few big transfers.
Very large rule sets
More rules may increase processing time and update time.
Reducing load sensibly
Do not send traffic through the firewall that gains nothing from it. For example, large data copies between two trusted servers in the same subnet do not need inspection; keep them local. Use private endpoints and platform firewalls for services that have their own protection. Group servers sensibly so noisy traffic stays away from the hub.
Latency
Every extra hop adds a little time. A firewall adds typically small delays, but a design that sends a connection through two firewalls and across regions adds up. Keep paths short and avoid sending traffic to a distant hub when a local one exists.
Record throughput and response times before turning on a heavy feature, and again afterward. You then see its true effect instead of guessing.
15High Availability and Resilience
If the gate stops working, either everyone is shut out or everyone walks in. Neither is acceptable, so plan for failure.
Availability zones
In supported regions you can deploy the firewall across several availability zones, which are separate buildings with their own power and cooling in one region. If one zone fails, instances in others keep working. This raises the availability promise, but spread the servers behind it as well. Zone choice must be made when creating the firewall in some cases, so decide early. Verify the current service level and options in the documentation.
Planned maintenance
Microsoft updates the underlying machines. The managed design is meant to roll updates without interruption, but long-lived connections may reset. Applications should reconnect gracefully.
Across regions
One firewall belongs to one region. For protection against a region-wide outage, deploy a second hub and firewall in another region, with applications replicated there, and use global routing or DNS to move users. Keep both firewalls on matching policies, which is easy when they share a base policy. Practice the failover regularly.
flowchart LR
subgraph RA["Region A"]
FA["Firewall across zones"] --> AA["Applications A"]
end
subgraph RB["Region B"]
FB["Firewall across zones"] --> AB["Applications B"]
end
POLB["Shared base policy"] -.-> FA
POLB -.-> FB
U["Users and on-premises"] --> FA
U -. "failover path" .-> FB
Fail open or fail closed
If the firewall is unreachable, traffic through it stops, which is fail closed and safe, but business stops too. Some teams worry and add bypass routes. Such bypasses defeat the point of the gate. The better answer is making the firewall itself resilient and testing recovery steps, not adding a secret back door.
Backup of configuration
Keep policies in code. If a policy is damaged or deleted, you can recreate it quickly. Use resource locks on production firewalls and policies so that no one deletes them by accident.
Failure modes to expect
| Failure | Effect | Defense |
|---|---|---|
| Wrong route table change | Traffic bypasses or never reaches the firewall | Review, code, effective route checks |
| Rule deleted or edited wrongly | Service blocked or exposed | Version control, quick rollback, alerts |
| Zone outage | Reduced capacity or short blip | Zone-spread deployment |
| Port exhaustion | New outbound connections fail | More public addresses or a NAT gateway |
| Region outage | Whole hub unavailable | Second region and tested failover |
| Inspection certificate expires | Encrypted inspection breaks applications | Alerts and rotation schedule |
16Monitoring, Logging and Troubleshooting
A guard who writes nothing down cannot answer questions later. Logs and metrics make the firewall explainable.
Metrics
Metrics are numbers over time. Useful ones include throughput, the number of processed connections, how many rule hits were applications versus network rules, the health state of the firewall, counts of SNAT port use, and latency probe results. Chart them on a dashboard and learn what normal looks like.
Logs
Log categories include application rule logs, network rule logs, NAT rule logs, threat intelligence logs, intrusion detection logs, DNS proxy logs and flow trace logs. Send them to a Log Analytics workspace to search with queries, to a storage account for long retention, or to an event stream for outside tools. Structured logs let you find, for example, every denied connection from one server in the last hour.
Useful questions the logs answer
Why can’t server X reach Y?
Search for denies from X to Y. The log shows which rule or default denied the connection.
Which rules are never used?
Count hits per rule over ninety days to find candidates for removal.
Who is talking to a bad address?
Search threat intelligence logs for sources and destinations.
What is our top traffic?
Summarize bytes by source, destination and rule to find heavy users.
Is anything odd at night?
Compare off-hours traffic with the normal pattern to spot unusual activity.
Did a change break something?
Line up the activity log of changes with a jump in denies.
Alerts worth having
Alert when the firewall health drops, when SNAT port use passes about eighty percent, when throughput nears the tier limit, when threat intelligence reports a deny, when denied traffic spikes suddenly and when any rule or policy changes outside the approved process.
A troubleshooting walk
Does traffic reach the firewall?
Look at effective routes on the source. Check the log for any entry with that source address.
What did the firewall decide?
Find the log entry and read the action and the rule name. A default deny shows no matching rule.
Is the rule order right?
A broader rule with a lower priority number may have matched first.
Are names resolving the same?
Compare the name resolution of the server and of the firewall for name-based rules.
Is the return path symmetric?
Check routes on the destination side so the reply passes the same firewall.
Are other layers blocking?
Subnet filters, the destination server’s own firewall or a service firewall may also deny.
Logs of busy firewalls can be huge. Choose the categories you truly use, set retention to your needs and archive older data cheaply.
17Understanding Cost
Azure Firewall is a premium security service, and its bill has a few parts. Prices change, so use the official calculator for real figures.
Deployment hour
You pay for each hour the firewall exists, whether or not traffic flows. The rate depends on the tier.
Data processed
A charge per gigabyte passing through the firewall.
Public addresses
Each public address has an hourly fee.
Data transfer
Peering between networks and traffic leaving Azure may be charged separately.
Logs and storage
Ingesting and keeping logs is a major hidden cost for busy firewalls.
People
Time spent designing, reviewing and tuning rules is often the biggest cost.
A worked monthly example
The numbers below are invented to show the method. Suppose a standard-tier firewall costs 1.25 dollars per hour. A month of 730 hours is 1.25 times 730, which is 912.50 dollars. If it processes 20 terabytes, which is 20,000 gigabytes, at an illustrative 0.016 dollars per gigabyte, that is 320 dollars. One public address at 0.005 dollars per hour is 3.65 dollars. The total is about 1,236.15 dollars before logs. Add a second firewall for a test hub that runs all month, and you add roughly another 916 dollars in hourly charges. That is why test firewalls should be deleted when idle or shared.
Ways to reduce cost
Share one firewall across many spokes in a hub rather than building one per application. Pick the tier to fit the need, not the maximum. Keep traffic that does not need inspection away from the firewall by using local controls. Deallocate or delete non-production firewalls outside working hours where the service allows it. Trim log categories and retention. Consider whether a simpler option, such as network security groups and platform firewalls, is enough for small isolated workloads.
Where money is wasted
Typical waste includes premium features that nobody uses, firewalls left running in forgotten test subscriptions, large volumes of low-value logs and duplicate firewalls built by separate teams. A quarterly review against traffic data finds these quickly.
Tags for owner, environment and cost center show who pays for what and highlight orphaned resources on the bill.
18Choosing Between Azure Security Services
Several Azure services protect networks. Each answers a different question, and they usually work together.
| Service | What it protects | Works at | Use it for |
|---|---|---|---|
| Azure Firewall | Traffic between networks and to the internet | Network and application level | Central rules, outbound control, inspection |
| Network security group | A subnet or one network interface | Addresses and ports | Simple, local, free filtering |
| Web application firewall | Public web applications | Web requests | Blocking web attacks on incoming traffic |
| DDoS protection | Public addresses | Network volume | Absorbing large floods |
| Private endpoints | Platform service access | Private addressing | Keeping service traffic off the internet |
| Bastion | Admin access to servers | Remote sessions | Safe remote login without public ports |
flowchart TD
Q["What do you need to control?"] --> A{"Incoming public web traffic?"}
A -->|"Yes"| W["Web application firewall at the front"]
A -->|"No"| B{"Traffic between networks or to the internet?"}
B -->|"Yes"| F["Azure Firewall in a hub"]
B -->|"No"| C{"Simple subnet-level filtering?"}
C -->|"Yes"| N["Network security group"]
C -->|"No"| O["Check private endpoints, bastion and other tools"]
Network security groups versus the firewall
Security groups are free, fast and local, but they work only with addresses, ports and tags. They have no names-based rules, no threat intelligence and no central view. Use them as a second layer for every subnet. Use the firewall for central policy, name-based rules, inspection and logs.
Third-party firewalls
Many vendors sell virtual firewall appliances in Azure. They bring familiar features and consoles to teams who use the same product on-premises, and sometimes offer advanced functions the native service lacks. The trade-offs are that you run and patch them, license them and design their high availability. Native services are easier to manage; appliances offer familiarity and special features. Compare against your real requirements.
Door locks on each room are like security groups. The main gate guard with a clipboard and cameras is the firewall. The airport bag scanner for visitors with luggage is the web application firewall. They solve different problems and a good building has all three.
19Advantages, Disadvantages and Trade-offs
An honest look at what the service does well and where it falls short.
Advantages
- Fully managed: no machines to patch, size or replace
- Stateful rules with default deny give a safe baseline
- Rules by website name keep up with changing addresses
- Threat intelligence adds protection without writing rules
- Central policy and inheritance across many networks
- Built-in scaling and zone support
- Tight integration with logging, identity and other Azure services
Disadvantages
- Costs more than free subnet filters, even when idle
- Not a web application firewall for public applications
- Depends on correct routing; a missing route means no protection
- Deep inspection lowers throughput and adds complexity
- Limits on rules and addresses require planning in big estates
- Scale-out takes minutes, so very sudden bursts can be hard
- Becomes a central dependency whose failure affects many systems
Key trade-offs
| Choice | Benefit | Cost |
|---|---|---|
| One central firewall | Lower cost, one set of rules and logs | Shared fate and shared limits |
| Many firewalls | Isolation and independence | Higher cost, more management |
| Inspect internal traffic | Stops sideways movement by attackers | More load, more rules, more latency |
| Premium tier | Deepest protection | Higher price, lower raw throughput, certificate care |
| Strict default deny | Smallest exposure | More requests for new rules |
| Broad allow rules | Fewer breakages | Weak security |
Finding balance
Security teams tend to want more control, and application teams want fewer obstacles. A workable balance is a clear request process with a fast approval path for low-risk rules, a standard set of common allows built into the base policy, and regular reviews to clean up. Making rules easy to request lowers the temptation to ask for “allow everything” just to avoid delays.
20Design Patterns and Anti-Patterns
Teams with good results repeat a few habits. Teams with bad results repeat a few mistakes. Naming both helps you copy the first and avoid the second.
Patterns that work
Default deny, explicit allow
Start with nothing allowed and add only what each system needs, with a reason attached.
Hub-and-spoke with a base policy
One firewall in the hub, a company-wide parent policy and a child policy per team.
Egress allow-list
Servers may reach only listed website names for updates and monitoring. Unknown destinations are denied and logged.
Micro-segmentation
Separate web, application and data tiers and allow only the exact flows between them.
Rules as code
Policies in version control, reviewed and deployed by pipelines.
Log-driven tightening
Begin with logged allows, study real traffic, then replace broad rules with precise ones.
Anti-patterns to avoid
Any-any rule
A rule allowing everything to everywhere “temporarily” that nobody removes.
Forgotten routes
A new subnet is created without a route table, so its traffic bypasses the firewall.
Alert-only forever
Threat and intrusion features left in alert mode with nobody reading the alerts.
Rule sprawl
Thousands of single-address rules with no names, owners or reviews.
Back door bypass
A hidden route that skips the firewall “for emergencies” and becomes the normal path.
Firewall as the only defense
No subnet filters, no hardening, no strong identity, so one rule mistake exposes everything.
21Best Practices and Common Mistakes
A checklist to apply before any firewall carries real traffic.
Best practices
Design the network first
Draw hubs, spokes, subnets, routes and flows before creating anything.
Use policies and parents
Put common rules in a parent policy and let teams add their own below.
Prefer names and tags to raw addresses
Use website names, FQDN tags, service tags and IP groups so rules stay valid when addresses change.
Turn on threat intelligence in deny mode
After a short alert-only trial, block known bad traffic automatically.
Log everything useful
Send rule, threat and DNS logs to a central workspace and build alerts.
Add public addresses or a NAT gateway for heavy outbound loads
Avoid port exhaustion before it surprises you.
Review rules every quarter
Remove unused, widen nothing without reason and confirm owners.
Test failure
Practice a bad rule rollback, a zone loss and a certificate expiry.
Common mistakes
| Mistake | Result | Prevention |
|---|---|---|
| Subnet name wrong or too small | Cannot deploy or scale | Use the required name and a roomy range |
| Route table not attached to a spoke | Traffic skips inspection | Automate routes, policy checks and effective route tests |
| Asymmetric return path | Mysterious dropped connections | Review routes on both sides |
| Network rule too broad | Application rules never consulted | Understand rule order and keep rules specific |
| Name rules without DNS proxy | Rules fail when addresses differ | Use the firewall as DNS proxy where needed |
| Premium inspection without client trust | Browsers show certificate errors | Distribute the authority certificate to all clients first |
| No log alerts | Attacks and faults go unnoticed | Create alerts for denies, threats and changes |
| Forgetting platform destinations | Updates and monitoring quietly fail | Allow required tags and test a fresh server |
22Failure Scenarios and Recovery
Walk through the failures before they happen, and recovery becomes routine.
Scenario one: a new application cannot reach its database
A team deploys an application in a new spoke. Connections to the database time out. The firewall log shows nothing. Cause: the spoke has no route table, so traffic never reached the firewall and was blocked by another layer, or went the wrong way. Recovery: attach the route table and add the needed rule. Prevention: create the spoke from a template that includes routes.
Scenario two: everything to the internet stops at once
Servers cannot download updates or reach any website. Cause: a recent change to a parent policy, or port exhaustion on the public address. Recovery: check the activity log for the latest policy change, revert it, or add public addresses. Prevention: change review, alerts on port use, and staged rollout of base policy changes.
Scenario three: a legitimate site is blocked
Staff cannot reach a business partner’s site. Cause: the site falls in a blocked category or appears in a threat feed. Recovery: confirm that it is safe through the security team, then add a narrow exception with an expiry date and a note. Prevention: a defined exception process.
Scenario four: encrypted inspection breaks an application
After turning on decryption, one application fails with certificate errors. Cause: the application pins certificates or uses client certificates, which cannot work with a middleman. Recovery: exclude that destination from decryption, record the reason and review it later. Prevention: pilot with a few machines before enabling widely.
Scenario five: compromised server talks to a bad address
Threat intelligence logs show a server connecting to a known malicious address, and the connection was denied. Action: isolate the server, review its logs, change credentials it held, and search the logs for other servers contacting the same destination. Prevention: alerts that notify the team in minutes.
Scenario six: a region outage
The hub’s region fails. Recovery: move traffic to the second region’s hub, which uses the same base policy, and follow the tested runbook. Prevention: a second hub, replicated data and regular drills.
flowchart TD
A["Connection fails"] --> B{"Entry in firewall log?"}
B -->|"No"| C["Check routes and subnet filters"]
B -->|"Yes, denied"| D["Find rule or default deny, then adjust rule or priority"]
B -->|"Yes, allowed"| E["Check destination server, DNS and return path"]
C --> F["Retest and confirm in log"]
D --> F
E --> F
Before each change, make sure the previous policy version is stored in version control. Fast rollback matters more than a perfect explanation when users are blocked.
23Deployment, Change Management and Governance
The firewall is shared infrastructure. Treat changes to it with the care you would give the main gate of a busy city.
Build from code
Write the firewall, policies, route tables and peering as code and keep them in version control. Every change then has an author, a reason, a reviewer and a history. Test, staging and production can be built from the same files with different settings, so a rule that works in test behaves the same in production.
A safe change path
Request
The team states what traffic is needed, from where to where, on which port, and for how long.
Review
A security reviewer checks that the request is narrow, justified and not already covered.
Preview
The deployment tool shows exactly what will be added, changed or removed.
Test environment first
Apply to a test firewall and run connection checks.
Apply and verify
Deploy to production, confirm hits in the log, and watch for new denies.
Review later
Temporary rules carry an expiry date and are removed automatically or reviewed on that date.
Governance with policy
Azure Policy can enforce rules about the environment itself: every subnet must have a route table that points to the firewall, no virtual machine may have a public address, firewalls must send logs to the central workspace. These checks prevent the quiet drift that weakens security over time.
Ownership
Assign a clear owner for the firewall platform, for the base policy and for each child policy. Write down how requests are made, how fast they are handled and who approves emergency changes. Ambiguity causes both delays and dangerous shortcuts.
Documentation
Keep a simple diagram of the network, a list of what each rule collection is for, and a runbook for the six scenarios in the previous chapter. A new team member should be able to understand the design in an afternoon.
Moving from old firewalls
When replacing an on-premises or virtual appliance firewall, do not copy thousands of old rules blindly. Analyze which are used, translate them into groups and names, clean up, test in a copy of the network, and cut over in stages with a clear rollback. Migration is a chance to tidy years of accumulated rules.
Every temporary rule gets an expiry date and an owner at creation. Without a date, temporary rules become permanent.
24Real-World Usage Examples
These are typical, invented scenarios that show the ideas at work. They are not reports about any named company.
An online shop locks down outbound access
A shop discovers that its servers can reach any website, which worries its security auditor. The team places a firewall in a hub and writes an allow-list of update sites, payment providers and monitoring endpoints. Anything else is denied and logged. Within a week the logs reveal an old reporting script calling an unknown address, which is removed. The next audit passes easily.
A bank inspects traffic between tiers
A regulated firm requires that all traffic between web, application and data tiers is inspected and logged. A premium firewall inspects the flows, intrusion detection runs in alert mode first and moves to prevention after tuning. Logs are kept for the legally required period in a protected workspace, and rule changes need two approvals.
A platform team offers networking as a service
A central team runs the hub, firewall and base policy. Application teams request a spoke through a template that includes the route table and a standard set of allowed destinations. They add their own rules in a child policy. New projects get a safe network in an hour instead of weeks.
Protecting patient data across offices and cloud
A healthcare group connects clinics to Azure over private links. All traffic from clinics to cloud systems passes through the hub firewall, which allows only the specific applications each clinic needs. Encrypted inspection is limited to general internet browsing, and health-related categories are excluded to protect privacy.
Factories talking to cloud analytics
Machines on factory floors send sensor data to cloud analytics. The firewall allows only the sensor gateways to reach the ingestion service on the needed port, and denies everything else. If a machine is infected, it cannot scan the rest of the network or reach unknown internet addresses.
What they share
Each example starts from deny, writes narrow rules, uses logs to learn and adjust, and treats rules as controlled changes. The tool helped, but the discipline made the difference.
25Testing and Validating Your Rules
A rule that has never been tested is only a hope. Careful testing shows that the firewall allows what it should and blocks what it should.
Test both directions
Most people test only that the needed traffic works. A complete test also proves that the unwanted traffic fails. If the web tier may reach the database on one port, test that connection, and also test that it cannot reach the database on another port, that the database cannot start connections back to the web tier, and that a server in another spoke cannot reach the database at all. A firewall passes its exam only when the forbidden doors stay shut.
Build a test list from the design
Take the network diagram and list every flow that should be allowed. Then list a handful of flows that must be denied, chosen as the most dangerous ones: remote login from the internet, database access from the wrong tier, outbound access to a random website, and traffic to a known bad test address provided by your security team. Write each as a simple sentence with source, destination, port and expected result. This list becomes a repeatable checklist that you can run after every change.
| Test | Expected result | What a failure means |
|---|---|---|
| Web tier to database on database port | Allowed and logged | Missing rule or missing route |
| Web tier to database on another port | Denied | A rule is wider than intended |
| Spoke server to the approved update site | Allowed by application rule | Name resolution or rule problem |
| Spoke server to a random website | Denied by default | A broad allow exists somewhere |
| Internet to a private server on remote login port | No answer | An address translation rule or public address is exposed |
| Spoke to spoke without a rule | Denied | Rules or routes allow sideways movement |
Use the logs as the judge
For each test, look at the log entry, not just the result on the screen. The log shows which rule matched and whether the action was allow or deny. If a test works but shows a match on an unexpected broad rule, you have found a weakness even though the connection succeeded.
Test in a copy first
Build a small test network from the same code as production and run the checklist there before any production change. Automate the checklist with scripts, so it runs in a pipeline after each deployment and a failed test stops the release.
Test the surrounding systems
Test the failures you fear: remove a route and see what happens; fill a log workspace and see if alerts fire; let a test certificate expire and watch how the applications react. These drills are best done on purpose, in daylight, with the team ready, rather than discovered at three in the morning.
Re-test on a schedule
Networks drift. People add exceptions, services change addresses and new teams join. Run the checklist every month, and after any large change. Compare results to the previous run, and follow up on every difference.
A fire alarm is tested by pulling the test button, not by waiting for a fire. A firewall is tested by trying doors that should be locked, not only the ones that should be open.
26Frequently Asked Questions
Short answers to common questions. Where a detail may have changed, confirm in the current Microsoft documentation.
27Summary and Key Takeaways
Azure Firewall is the managed gatekeeper of your cloud network. It remembers conversations, applies rules by address and by name, blocks known bad traffic and records what it decides.
Key takeaways
- It is a managed, stateful firewall with default deny; only traffic you explicitly allow can pass, and everything is logged.
- Rules only work on traffic that reaches the firewall, so design routes first and check effective routes when things break.
- Use network rules for addresses and ports, application rules for website names, and remember the order in which they are evaluated.
- Choose the tier by need: Standard for most production, Premium for intrusion prevention and encrypted inspection, with attention to cost, privacy and certificates.
- Use a hub-and-spoke layout with a parent policy and child policies, written as code and changed through review.
- Pair it with subnet filters, a web application firewall for public sites, private endpoints and strong identity; no single layer is enough.
- Monitor logs and metrics, plan for port exhaustion and zone or region failure, and verify limits, features and prices in the current Microsoft documentation.