Coming Soon: GET:IT Endpoint Management 1-Day Conference on September 28th at 9:30 AM ET Coming Soon: GET:IT Endpoint Management 1-Day Conference on September 28th at 9:30 AM ET
Microsoft Azure

The Three Different Types of Rules that are in the Azure Firewall

Block by Default

There are three kinds of rules that you can configure in the Azure Firewall. We’ll delve in these in a few moments, but the first thing you should know is that the Azure Firewall blocks traffic by default. If you do not enable it, it is not allowed … almost entirely … but I’ll explain that later in the post.

The three kinds of rule sets are:

  • NAT Rules
  • Network Rules
  • Application Rules
Configuring rules in the Azure Firewall [Image Credit: Aidan Finn]
Configuring rules in the Azure Firewall [Image Credit: Aidan Finn]

NAT Rules

The Azure Firewall allows you to share network services with external networks, such as on-premises or the Internet through the inspection and logging of the firewall. This traffic routes through the external public IP address of the firewall. Scenarios that you might consider are publishing SSH, RDP, or non-HTTP/S applications to the Internet.

Sponsored Content

Say Goodbye to Traditional PC Lifecycle Management

Traditional IT tools, including Microsoft SCCM, Ghost Solution Suite, and KACE, often require considerable custom configurations by T3 technicians (an expensive and often elusive IT resource) to enable management of a hybrid onsite + remote workforce. In many cases, even with the best resources, organizations are finding that these on-premise tools simply cannot support remote endpoints consistently and reliably due to infrastructure limitations.

Microsoft refers to the form of NAT as being Destination Network Address Translation (DNAT). The rules work with the following parameters:

  • Name: A label for the rule.
  • Protocol: TCP or UDP.
  • Source Address: * (Internet), a specific Internet address, or a CIDR block.
  • Destination Address: Expect this to be renamed – this refers to the external address of the firewall that the rule will inspect.
  • Destination Ports: The TCP or UDP ports that the rule will listen to on the external IP address of the firewall.
  • Translated Address: The IP address of the service (virtual machine, internal load balancer, and so on) that privately hosts or presents the service.
  • Translated Port: The port that the inbound traffic will be routed to by the Azure Firewall.

Quite often in traditional firewall management, a NAT rule that routes traffic must be accompanied by a matching network rule to allow the traffic. In the case of the Azure Firewall, once you create a NAT rule, the firewall implicitly creates a hidden network rule to reduce your management effort and complexity – I do like this!

Network Rules

Any non-HTTP/S traffic that will be allowed to flow through the firewall must have a network rule – note the above time-saving feature in NAT rules. For example, if I have one subnet with web servers that must talk to a SQL Server in another subnet, then I must have a network rule to allow TCP 1433 from the source subnet to the destination subnet.

The following parameters are used to configure a network rule:

  • Name: A friendly label for the rule.
  • Protocol: This can be TCP, UDP, ICMP (ping and traceroute) or Any.
  • Source Address: The address or CIDR block of the source.
  • Destination Addresses: The addresses or CIDR blocks of the destination(s).
  • Destination Ports: The destination port of the traffic.

Application Rules

The third and final set of rules deals with HTTP/HTTPS traffic at Layer-7 in the networking stack. Here you will specify what web application traffic you want to allow to flow through the firewall. We will start with Target FQDNs (fully qualified domain names) where you are dealing with non-Microsoft services:

  • Name: A friendly label for the rule.
  • Source Addresses: The IP address of the source.
  • Protocol:Port: Whether this is for HTTP/HTTPS and the port that the web server is listening on.
  • Target FQDNs: The domain name of the service, such as Note that wildcards can be used, such as * (everything at or even * (the entire Internet).

There is a second kind of application rule called FQDN Tags, referred to in Microsoft’s documentation as the Infrastructure Rule Collection. Remember that the Azure Firewall blocks everything by default. If you do not specify a domain name or a suitable wildcard, then that traffic is not allowed. As a result, things like Azure Backup or Diagnostics traffic from virtual machines will be blocked if your user-defined routing (UDR) directs that traffic through the Azure Firewall. Microsoft provides a number of FQDN tags that can be used in special application rules to allow this web traffic – this list will probably grow over time:

  • AppServiceEnvironment: The private deployment of Azure App Services.
  • Azure Backup: Protecting virtual machine-based services.
  • MicrosoftActiveProtectionService: Windows Defender Antivirus.
  • WindowsDiagnostics: Storing data from VNet-connected resources to a storage account.
  • WindowsUpdate: Patching your Windows virtual machines.

How These Rules Are Processed

The three types of rules can be broken down into two sets:

  • NAT: This is a routing rule, directing traffic from a public IP address to a private IP address. A hidden network rule is automatically created to allow the traffic.
  • Network Rules and Application Rules: These rules specify what traffic is allowed through the Azure Firewall.

So when a packet is being inspected to determine if it is allowed or not (not is the default) then only Network Rules and Application Rules are used for filtering. They are processed in this order:

  1. Network Rules
  2. Application Rules

In reality, the ordering is a bit more detailed because Application Rules have two types:

  1. Network Rules
  2. Application Rules – Target FQDNs
  3. Application Rules – FQDN Tags

The rules are terminating. Once a positive match is found, allowing the traffic through, no more rules are checked.

Related Topics:


Don't have a login but want to join the conversation? Sign up for a Petri Account

Comments (3)

3 responses to “The Three Different Types of Rules that are in the Azure Firewall”

  1. <p><br></p><p><br></p><p><br></p><p>Resolving (…</p><p>Connecting to (||:443… connected.</p><p>Unable to establish SSL connection.</p>

  2. <p><br></p><p>I have a application rule to download a giturl, The rule is as below</p><p><br></p><p>When i was trying to download from the git url it was failing with following issue</p>

Leave a Reply

Aidan Finn, Microsoft Most Valuable Professional (MVP), has been working in IT since 1996. He has worked as a consultant and administrator for the likes of Innofactor Norway, Amdahl DMR, Fujitsu, Barclays and Hypo Real Estate Bank International where he dealt with large and complex IT infrastructures and MicroWarehouse Ltd. where he worked with Microsoft partners in the small/medium business space.
Live Webinar: Active Directory Security: What Needs Immediate Priority!Live on Tuesday, October 12th at 1 PM ET

Attacks on Active Directory are at an all-time high. Companies that are not taking heed are being punished, both monetarily and with loss of production.

In this webinar, you will learn:

  • How to prioritize vulnerability management
  • What attackers are leveraging to breach organizations
  • Where Active Directory security needs immediate attention
  • Overall strategy to secure your environment and keep it secured

Sponsored by: