Azure Firewall
Azure Firewall
Azure Firewall
Azure Firewall is a managed, cloud-based network security service that protects your Azure Virtual Network
resources. It's a fully stateful firewall as a service with built-in high availability and unrestricted cloud scalability.
You can centrally create, enforce, and log application and network connectivity policies across subscriptions and
virtual networks. Azure Firewall uses a static public IP address for your virtual network resources allowing outside
firewalls to identify traffic originating from your virtual network. The service is fully integrated with Azure Monitor
for logging and analytics.
Features
To learn about Azure Firewall features, see Azure Firewall features.
Known issues
Azure Firewall has the following known issues:
Network filtering rules for non- Network filtering rules for non- Azure Firewall uses the Standard Load
TCP/UDP protocols (for example ICMP) TCP/UDP protocols don't work with Balancer, which doesn't support SNAT
don't work for Internet bound traffic SNAT to your public IP address. Non- for IP protocols today. We're exploring
TCP/UDP protocols are supported options to support this scenario in a
between spoke subnets and VNets. future release.
ISSUE DESC RIP T IO N M IT IGAT IO N
Missing PowerShell and CLI support for Azure PowerShell and CLI don't support It's still possible to use ICMP as a
ICMP ICMP as a valid protocol in network protocol via the portal and the REST
rules. API. We're working to add ICMP in
PowerShell and CLI soon.
FQDN tags require a protocol: port to Application rules with FQDN tags You can use https as the port: protocol
be set require port: protocol definition. value. We're working to make this field
optional when FQDN tags are used.
Moving a firewall to a different resource Moving a firewall to a different resource Supporting this functionality is on our
group or subscription isn't supported group or subscription isn't supported. road map. To move a firewall to a
different resource group or subscription,
you must delete the current instance
and recreate it in the new resource
group or subscription.
Threat intelligence alerts may get Network rules with destination 80/443 Create outbound filtering for 80/443
masked for outbound filtering masks threat using application rules. Or, change the
intelligence alerts when configured to threat intelligence mode to Aler t and
alert only mode. Deny .
Azure Firewall DNAT doesn't work for Azure Firewall DNAT support is limited This is a current limitation.
private IP destinations to Internet egress/ingress. DNAT
doesn't currently work for private IP
destinations. For example, spoke to
spoke.
Can't remove first public IP Each Azure Firewall public IP address is This is by design.
configuration assigned to an IP configuration. The
first IP configuration is assigned during
the firewall deployment, and typically
also contains a reference to the firewall
subnet (unless configured explicitly
differently via a template deployment).
You can't delete this IP configuration
because it would de-allocate the
firewall. You can still change or remove
the public IP address associated with
this IP configuration if the firewall has at
least one other public IP address
available to use.
Availability zones can only be Availability zones can only be This is by design.
configured during deployment. configured during deployment. You
can't configure Availability Zones after a
firewall has been deployed.
SNAT on inbound connections In addition to DNAT, connections via To preserve the original source for
the firewall public IP address (inbound) HTTP/S, consider using XFF headers. For
are SNATed to one of the firewall private example, use a service such as Azure
IPs. This requirement today (also for Front Door or Azure Application
Active/Active NVAs) to ensure Gateway in front of the firewall. You can
symmetric routing. also add WAF as part of Azure Front
Door and chain to the firewall.
ISSUE DESC RIP T IO N M IT IGAT IO N
SQL FQDN filtering support only in For Azure SQL Database, Azure Synapse For SQL in redirect mode (the default if
proxy mode (port 1433) Analytics, and Azure SQL Managed connecting from within Azure), you can
Instance: instead filter access using the SQL
service tag as part of Azure Firewall
During the preview, SQL FQDN filtering network rules.
is supported in proxy-mode only (port
1433).
Outbound traffic on TCP port 25 isn't Outbound SMTP connections that use Follow the recommended method to
allowed TCP port 25 are blocked. Port 25 is send email, as documented in the SMTP
primarily used for unauthenticated troubleshooting article. Or, exclude the
email delivery. This is the default virtual machine that needs outbound
platform behavior for virtual machines. SMTP access from your default route to
For more information, see more the firewall. Instead, configure
Troubleshoot outbound SMTP outbound access directly to the
connectivity issues in Azure. However, internet.
unlike virtual machines, it isn't currently
possible to enable this functionality on
Azure Firewall. Note: to allow
authenticated SMTP (port 587) or
SMTP over a port other than 25, please
make sure you configure a network rule
and not an application rule as SMTP
inspection is not supported at this time.
Active FTP isn't supported Active FTP is disabled on Azure Firewall You can use Passive FTP instead. You
to protect against FTP bounce attacks must still explicitly open TCP ports 20
using the FTP PORT command. and 21 on the firewall.
SNAT port utilization metric shows 0% The Azure Firewall SNAT port utilization This issue has been fixed and rollout to
metric may show 0% usage even when production is targeted for May 2020. In
SNAT ports are used. In this case, using some cases, firewall redeployment
the metric as part of the firewall health resolves the issue, but it's not
metric provides an incorrect result. consistent. As an intermediate
workaround, only use the firewall health
state to look for status=degraded, not
for status=unhealthy. Port exhaustion
will show as degraded. Not healthy is
reserved for future use when the are
more metrics to impact the firewall
health.
DNAT isn't supported with Forced Firewalls deployed with Forced This is by design because of asymmetric
Tunneling enabled Tunneling enabled can't support routing. The return path for inbound
inbound access from the Internet connections goes via the on-premises
because of asymmetric routing. firewall, which hasn't seen the
connection established.
ISSUE DESC RIP T IO N M IT IGAT IO N
Outbound Passive FTP may not work Passive FTP establishes different An explicit SNAT configuration is
for Firewalls with multiple public IP connections for control and data planned. In the meantime, you can
addresses, depending on your FTP channels. When a Firewall with multiple configure your FTP server to accept
server configuration. public IP addresses sends data data and control channels from different
outbound, it randomly selects one of its source IP addresses (see an example for
public IP addresses for the source IP IIS). Alternatively, consider using a single
address. FTP may fail when data and IP address in this situation.
control channels use different source IP
addresses, depending on your FTP
server configuration.
Inbound Passive FTP may not work Passive FTP establishes different Preserving the original source IP
depending on your FTP server connections for control and data address is being investigated. In the
configuration channels. Inbound connections on meantime, you can configure your FTP
Azure Firewall are SNATed to one of the server to accept data and control
firewall private IP address to ensure channels from different source IP
symmetric routing. FTP may fail when addresses.
data and control channels use different
source IP addresses, depending on your
FTP server configuration.
NetworkRuleHit metric is missing a The ApplicationRuleHit metric allows A fix is being investigated.
protocol dimension filtering based protocol, but this
capability is missing in the
corresponding NetworkRuleHit metric.
NAT rules with ports between 64000 Azure Firewall allows any port in the 1- This is a current limitation.
and 65535 are unsupported 65535 range in network and application
rules, however NAT rules only support
ports in the 1-63999 range.
Configuration updates may take five An Azure Firewall configuration update A fix is being investigated.
minutes on average can take three to five minutes on
average, and parallel updates aren't
supported.
Azure Firewall uses SNI TLS headers to If browser or server software does not If browser or server software does not
filter HTTPS and MSSQL traffic support the Server Name Indicator support SNI, then you may be able to
(SNI) extension, you won't be able to control the connection using a network
connect through Azure Firewall. rule instead of an application rule. See
Server Name Indication for software
that supports SNI.
Custom DNS (preview) doesn't work If force tunneling is enabled, custom A fix is being investigated.
with forced tunneling DNS (preview) doesn't work.
New public IP address support for You can't add a new public IP address This is a public IP address resource
multiple Availability Zones when you deploy a firewall with two limitation.
availability zones (either 1 and 2, 2 and
3, or 1 and 3)
ISSUE DESC RIP T IO N M IT IGAT IO N
Start/Stop doesn’t work with a firewall Start/stop doesn’t work with Azure Under investigation.
configured in forced-tunnel mode firewall configured in forced-tunnel
mode. Attempting to start Azure As a workaround, you can delete the
Firewall with forced tunneling existing firewall and create a new one
configured results in the following error: with the same parameters.
Next steps
Tutorial: Deploy and configure Azure Firewall using the Azure portal
Deploy Azure Firewall using a template
Create an Azure Firewall test environment
Quickstart: Create an Azure Firewall and IP Groups -
ARM template
10/25/2020 • 6 minutes to read • Edit Online
In this quickstart, you use an Azure Resource Manager template (ARM template) to deploy an Azure Firewall with
sample IP Groups used in a network rule and application rule. An IP Group is a top-level resource that allows you to
define and group IP addresses, ranges, and subnets into a single object. This is useful for managing IP addresses in
Azure Firewall rules. You can either manually enter IP addresses or import them from a file.
An ARM template is a JavaScript Object Notation (JSON) file that defines the infrastructure and configuration for
your project. The template uses declarative syntax, which lets you state what you intend to deploy without having to
write the sequence of programming commands to create it.
If your environment meets the prerequisites and you're familiar with using ARM templates, select the Deploy to
Azure button. The template will open in the Azure portal.
Prerequisites
An Azure account with an active subscription. Create an account for free.
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"virtualNetworkName": {
"type": "string",
"defaultValue": "[concat('vnet', uniqueString(resourceGroup().id))]",
"metadata": {
"description": "virtual network name"
}
},
"ipgroups_name1": {
"defaultValue": "[concat('ipgroup1', uniqueString(resourceGroup().id))]",
"type": "String"
},
"ipgroups_name2": {
"defaultValue": "[concat('ipgroup2', uniqueString(resourceGroup().id))]",
"type": "String"
},
"adminUsername": {
"type": "string",
"metadata": {
"description": "Username for the Virtual Machine."
}
},
"location": {
"type": "string",
"type": "string",
"defaultValue": "[resourceGroup().location]",
"metadata": {
"description": "Location for all resources."
}
},
"vmSize": {
"type": "string",
"defaultValue": "Standard_DS1_v2",
"metadata": {
"description": "Zone numbers e.g. 1,2,3."
}
},
"numberOfFirewallPublicIPAddresses": {
"type": "int",
"defaultValue": 1,
"minValue": 1,
"maxValue": 100,
"metadata": {
"description": "Number of public IP addresses for the Azure Firewall"
}
},
"authenticationType": {
"type": "string",
"defaultValue": "sshPublicKey",
"allowedValues": [
"sshPublicKey",
"password"
],
"metadata": {
"description": "Type of authentication to use on the Virtual Machine. SSH key is recommended."
}
},
"adminPasswordOrKey": {
"type": "securestring",
"metadata": {
"description": "SSH Key or password for the Virtual Machine. SSH key is recommended."
}
}
},
"variables": {
"vnetAddressPrefix": "10.0.0.0/16",
"serversSubnetPrefix": "10.0.2.0/24",
"azureFirewallSubnetPrefix": "10.0.1.0/24",
"jumpboxSubnetPrefix": "10.0.0.0/24",
"nextHopIP": "10.0.1.4",
"azureFirewallSubnetName": "AzureFirewallSubnet",
"jumpBoxSubnetName": "JumpboxSubnet",
"serversSubnetName": "ServersSubnet",
"jumpBoxPublicIPAddressName": "JumpHostPublicIP",
"jumpBoxNsgName": "JumpHostNSG",
"jumpBoxNicName": "JumpHostNic",
"jumpBoxSubnetId": "[resourceId('Microsoft.Network/virtualNetworks/subnets',
parameters('virtualNetworkName'), variables('jumpBoxSubnetName'))]",
"serverNicName": "ServerNic",
"serverSubnetId": "[resourceId('Microsoft.Network/virtualNetworks/subnets',
parameters('virtualNetworkName'), variables('serversSubnetName'))]",
"storageAccountName": "[concat(uniquestring(resourceGroup().id), 'sajumpbox')]",
"azfwRouteTableName": "AzfwRouteTable",
"firewallName": "firewall1",
"publicIPNamePrefix": "publicIP",
"azureFirewallSubnetId": "
[resourceId('Microsoft.Network/virtualNetworks/subnets',parameters('virtualNetworkName'),
variables('azureFirewallSubnetName'))]",
"azureFirewallSubnetJSON": "[json(format('{{\"id\": \"{0}\"}}', variables('azureFirewallSubnetId')))]",
"copy": [
{
"name": "azureFirewallIpConfigurations",
"count": "[parameters('numberOfFirewallPublicIPAddresses')]",
"input": {
"input": {
"name": "[concat('IpConf', copyIndex('azureFirewallIpConfigurations'))]",
"properties": {
"subnet": "[if(equals(copyIndex('azureFirewallIpConfigurations'), 0),
variables('azureFirewallSubnetJSON'), json('null'))]",
"publicIPAddress": {
"id": "[resourceId('Microsoft.Network/publicIPAddresses', concat(variables('publicIPNamePrefix'),
add(copyIndex('azureFirewallIpConfigurations'), 1)))]"
}
}
}
}
],
"linuxConfiguration": {
"disablePasswordAuthentication": true,
"ssh": {
"publicKeys": [
{
"path": "[concat('/home/', parameters('adminUsername'), '/.ssh/authorized_keys')]",
"keyData": "[parameters('adminPasswordOrKey')]"
}
]
}
},
"networkSecurityGroupName": "[concat(variables('serversSubnetName'), '-nsg')]"
},
"resources": [
{
"type": "Microsoft.Network/ipGroups",
"apiVersion": "2020-06-01",
"name": "[parameters('ipgroups_name1')]",
"location": "[parameters('location')]",
"properties": {
"ipAddresses": [
"13.73.64.64/26",
"13.73.208.128/25",
"52.126.194.0/23"
]
}
},
{
"type": "Microsoft.Network/ipGroups",
"apiVersion": "2020-06-01",
"name": "[parameters('ipgroups_name2')]",
"location": "[parameters('location')]",
"properties": {
"ipAddresses": [
"12.0.0.0/24",
"13.9.0.0/24"
]
}
},
{
"type": "Microsoft.Storage/storageAccounts",
"apiVersion": "2019-06-01",
"name": "[variables('storageAccountName')]",
"location": "[parameters('location')]",
"sku": {
"name": "Standard_LRS"
},
"kind": "StorageV2",
"properties": {}
},
{
"type": "Microsoft.Network/routeTables",
"apiVersion": "2020-06-01",
"name": "[variables('azfwRouteTableName')]",
"location": "[parameters('location')]",
"properties": {
"disableBgpRoutePropagation": false,
"disableBgpRoutePropagation": false,
"routes": [
{
"name": "AzfwDefaultRoute",
"properties": {
"addressPrefix": "0.0.0.0/0",
"nextHopType": "VirtualAppliance",
"nextHopIpAddress": "[variables('nextHopIP')]"
}
}
]
}
},
{
"comments": "Simple Network Security Group for subnet [variables('serversSubnetName')]",
"type": "Microsoft.Network/networkSecurityGroups",
"apiVersion": "2020-06-01",
"name": "[variables('networkSecurityGroupName')]",
"location": "[parameters('location')]",
"properties": {}
},
{
"type": "Microsoft.Network/virtualNetworks",
"apiVersion": "2020-06-01",
"name": "[parameters('virtualNetworkName')]",
"location": "[parameters('location')]",
"dependsOn": [
"[resourceId('Microsoft.Network/routeTables', variables('azfwRouteTableName'))]",
"[resourceId('Microsoft.Network/networkSecurityGroups', variables('networkSecurityGroupName'))]"
],
"tags": {
"displayName": "[parameters('virtualNetworkName')]"
},
"properties": {
"addressSpace": {
"addressPrefixes": [
"[variables('vnetAddressPrefix')]"
]
},
"subnets": [
{
"name": "[variables('jumpBoxSubnetName')]",
"properties": {
"addressPrefix": "[variables('jumpboxSubnetPrefix')]"
}
},
{
"name": "[variables('azureFirewallSubnetName')]",
"properties": {
"addressPrefix": "[variables('azureFirewallSubnetPrefix')]"
}
},
{
"name": "[variables('serversSubnetName')]",
"properties": {
"addressPrefix": "[variables('serversSubnetPrefix')]",
"routeTable": {
"id": "[resourceId('Microsoft.Network/routeTables', variables('azfwRouteTableName'))]"
},
"networkSecurityGroup": {
"id": "[resourceId('Microsoft.Network/networkSecurityGroups',
variables('networkSecurityGroupName'))]"
}
}
}
]
}
},
{
"type": "Microsoft.Network/publicIPAddresses",
"apiVersion": "2020-06-01",
"name": "[concat(variables('publicIPNamePrefix'), add(copyIndex(), 1))]",
"location": "[parameters('location')]",
"sku": {
"name": "Standard"
},
"copy": {
"name": "publicIpCopy",
"count": "[parameters('numberOfFirewallPublicIPAddresses')]"
},
"properties": {
"publicIPAllocationMethod": "Static",
"publicIPAddressVersion": "IPv4"
}
},
{
"type": "Microsoft.Network/publicIPAddresses",
"apiVersion": "2020-06-01",
"name": "[variables('jumpBoxPublicIPAddressName')]",
"location": "[parameters('location')]",
"properties": {
"publicIPAllocationMethod": "Dynamic"
}
},
{
"type": "Microsoft.Network/networkSecurityGroups",
"apiVersion": "2020-06-01",
"name": "[variables('jumpBoxNsgName')]",
"location": "[parameters('location')]",
"properties": {
"securityRules": [
{
"name": "myNetworkSecurityGroupRuleSSH",
"properties": {
"protocol": "Tcp",
"sourcePortRange": "*",
"destinationPortRange": "22",
"sourceAddressPrefix": "*",
"destinationAddressPrefix": "*",
"access": "Allow",
"priority": 1000,
"direction": "Inbound"
}
}
]
}
},
{
"type": "Microsoft.Network/networkInterfaces",
"apiVersion": "2020-06-01",
"name": "[variables('JumpBoxNicName')]",
"location": "[parameters('location')]",
"dependsOn": [
"[resourceId('Microsoft.Network/publicIPAddresses', variables('jumpBoxPublicIPAddressName'))]",
"[resourceId('Microsoft.Network/virtualNetworks', parameters('virtualNetworkName'))]",
"[resourceId('Microsoft.Network/networkSecurityGroups', variables('jumpBoxNsgName'))]"
],
"properties": {
"ipConfigurations": [
{
"name": "ipconfig1",
"properties": {
"privateIPAllocationMethod": "Dynamic",
"publicIPAddress": {
"id": "[resourceId('Microsoft.Network/publicIPAddresses',
variables('jumpBoxPublicIPAddressName'))]"
},
"subnet": {
"id": "[variables('jumpBoxSubnetId')]"
}
}
}
],
"networkSecurityGroup": {
"id": "[resourceId('Microsoft.Network/networkSecurityGroups', variables('jumpBoxNsgName'))]"
}
}
},
{
"type": "Microsoft.Network/networkInterfaces",
"apiVersion": "2020-06-01",
"name": "[variables('ServerNicName')]",
"location": "[parameters('location')]",
"dependsOn": [
"[resourceId('Microsoft.Network/virtualNetworks', parameters('virtualNetworkName'))]"
],
"properties": {
"ipConfigurations": [
{
"name": "ipconfig1",
"properties": {
"privateIPAllocationMethod": "Dynamic",
"subnet": {
"id": "[variables('serverSubnetId')]"
}
}
}
]
}
},
{
"type": "Microsoft.Compute/virtualMachines",
"apiVersion": "2020-06-01",
"name": "JumpBox",
"location": "[parameters('location')]",
"dependsOn": [
"[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]",
"[resourceId('Microsoft.Network/networkInterfaces', variables('JumpBoxNicName'))]"
],
"properties": {
"hardwareProfile": {
"vmSize": "[parameters('vmSize')]"
},
"storageProfile": {
"imageReference": {
"publisher": "Canonical",
"offer": "UbuntuServer",
"sku": "18.04-LTS",
"version": "latest"
},
"osDisk": {
"createOption": "FromImage"
}
},
"osProfile": {
"computerName": "JumpBox",
"adminUsername": "[parameters('adminUsername')]",
"adminPassword": "[parameters('adminPasswordOrKey')]",
"linuxConfiguration": "[if(equals(parameters('authenticationType'), 'password'), json('null'),
variables('linuxConfiguration'))]"
},
"networkProfile": {
"networkInterfaces": [
{
"id": "[resourceId('Microsoft.Network/networkInterfaces', variables('JumpBoxNicName'))]"
}
]
]
},
"diagnosticsProfile": {
"bootDiagnostics": {
"enabled": true,
"storageUri": "[reference(resourceId('Microsoft.Storage/storageAccounts',
variables('storageAccountName'))).primaryEndpoints.blob]"
}
}
}
},
{
"type": "Microsoft.Compute/virtualMachines",
"apiVersion": "2020-06-01",
"name": "Server",
"location": "[parameters('location')]",
"dependsOn": [
"[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]",
"[resourceId('Microsoft.Network/networkInterfaces', variables('ServerNicName'))]"
],
"properties": {
"hardwareProfile": {
"vmSize": "[parameters('vmSize')]"
},
"storageProfile": {
"imageReference": {
"publisher": "Canonical",
"offer": "UbuntuServer",
"sku": "18.04-LTS",
"version": "latest"
},
"osDisk": {
"createOption": "FromImage"
}
},
"osProfile": {
"computerName": "Server",
"adminUsername": "[parameters('adminUsername')]",
"adminPassword": "[parameters('adminPasswordOrKey')]",
"linuxConfiguration": "[if(equals(parameters('authenticationType'), 'password'), json('null'),
variables('linuxConfiguration'))]"
},
"networkProfile": {
"networkInterfaces": [
{
"id": "[resourceId('Microsoft.Network/networkInterfaces', variables('ServerNicName'))]"
}
]
},
"diagnosticsProfile": {
"bootDiagnostics": {
"enabled": true,
"storageUri": "[reference(resourceId('Microsoft.Storage/storageAccounts',
variables('storageAccountName'))).primaryEndpoints.blob]"
}
}
}
},
{
"type": "Microsoft.Network/azureFirewalls",
"apiVersion": "2020-06-01",
"name": "[variables('firewallName')]",
"location": "[parameters('location')]",
"dependsOn": [
"[resourceId('Microsoft.Network/ipGroups', parameters('ipgroups_name1'))]",
"[resourceId('Microsoft.Network/ipGroups', parameters('ipgroups_name2'))]",
"[resourceId('Microsoft.Network/virtualNetworks', parameters('virtualNetworkName'))]",
"publicIpCopy"
],
"properties": {
"properties": {
"ipConfigurations": "[variables('azureFirewallIpConfigurations')]",
"applicationRuleCollections": [
{
"name": "appRc1",
"properties": {
"priority": 101,
"action": {
"type": "Allow"
},
"rules": [
{
"name": "someAppRule",
"protocols": [
{
"protocolType": "Http",
"port": 8080
}
],
"targetFqdns": [
"*bing.com"
],
"sourceIpGroups": [
"[resourceId('Microsoft.Network/ipGroups', parameters('ipgroups_name1'))]"
]
},
{
"name": "someOtherAppRule",
"protocols": [
{
"protocolType": "Mssql",
"port": 1433
}
],
"targetFqdns": [
"[concat('sql1', environment().suffixes.sqlServerHostname)]"
],
"sourceIpGroups": [
"[resourceId('Microsoft.Network/ipGroups', parameters('ipgroups_name1'))]",
"[resourceId('Microsoft.Network/ipGroups', parameters('ipgroups_name2'))]"
]
}
]
}
}
],
"networkRuleCollections": [
{
"name": "netRc1",
"properties": {
"priority": 200,
"action": {
"type": "Allow"
},
"rules": [
{
"name": "networkRule",
"description": "desc1",
"protocols": [
"UDP",
"TCP",
"ICMP"
],
"sourceAddresses": [
"10.0.0.0",
"111.1.0.0/23"
],
"sourceIpGroups": [
"[resourceId('Microsoft.Network/ipGroups', parameters('ipgroups_name1'))]"
],
],
"destinationIpGroups": [
"[resourceId('Microsoft.Network/ipGroups', parameters('ipgroups_name2'))]"
],
"destinationPorts": [
"90"
]
}
]
}
}
]
}
}
]
}
2. In the portal, on the Create an Azure Firewall with IpGroups page, type or select the following values:
Subscription: Select from existing subscriptions
Resource group: Select from existing resource groups or select Create new , and select OK .
Location: Select a location
Virtual Network Name: Type a name for the new virtual network (VNet)
IP Group Name 1: Type name for IP Group 1
IP Group Name 2: Type name for IP Group 2
Admin Username: Type username for the administrator user account
Authentication: Select sshPublicKey or password
Admin Password: Type an administrator password or key
3. Select I agree to the terms and conditions stated above and then select Purchase . The deployment
can take 10 minutes or longer to complete.
Clean up resources
When you no longer need the resources that you created with the firewall, delete the resource group. This removes
the firewall and all the related resources.
To delete the resource group, call the Remove-AzResourceGroup cmdlet:
Next steps
Tutorial: Deploy and configure Azure Firewall in a hybrid network using the Azure portal
Quickstart: Create an Azure Firewall with multiple
public IP addresses - ARM template
10/25/2020 • 5 minutes to read • Edit Online
In this quickstart, you use an Azure Resource Manager template (ARM template) to deploy an Azure Firewall with
multiple public IP addresses from a public IP address prefix. The deployed firewall has NAT rule collection rules that
allow RDP connections to two Windows Server 2019 virtual machines.
An ARM template is a JavaScript Object Notation (JSON) file that defines the infrastructure and configuration for
your project. The template uses declarative syntax, which lets you state what you intend to deploy without having
to write the sequence of programming commands to create it.
For more information about Azure Firewall with multiple public IP addresses, see Deploy an Azure Firewall with
multiple public IP addresses using Azure PowerShell.
If your environment meets the prerequisites and you're familiar with using ARM templates, select the Deploy to
Azure button. The template will open in the Azure portal.
Prerequisites
An Azure account with an active subscription. Create an account for free.
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"adminUsername": {
"type": "String",
"metadata": {
"description": "Admin username for the backend servers"
}
},
"adminPassword": {
"type": "SecureString",
"metadata": {
"description": "Password for the admin account on the backend servers"
}
},
"location": {
"defaultValue": "[resourceGroup().location]",
"type": "String",
"metadata": {
"description": "Location for all resources."
}
},
"vmSize": {
"defaultValue": "Standard_B2ms",
"defaultValue": "Standard_B2ms",
"type": "String",
"metadata": {
"description": "Size of the virtual machine."
}
}
},
"variables": {
"virtualMachines_myVM_name": "myVM",
"virtualNetworks_myVNet_name": "myVNet",
"net_interface": "net-int",
"ipconfig_name": "ipconfig",
"ipprefix_name": "public_ip_prefix",
"ipprefix_size": 31,
"publicIPAddress": "public_ip",
"nsg_name": "vm-nsg",
"firewall_name": "FW-01",
"vnet_prefix": "10.0.0.0/16",
"fw_subnet_prefix": "10.0.0.0/24",
"backend_subnet_prefix": "10.0.1.0/24",
"azureFirewallSubnetId": "
[resourceId('Microsoft.Network/virtualNetworks/subnets',variables('virtualNetworks_myVNet_name'),
'AzureFirewallSubnet')]",
"azureFirewallSubnetJSON": "[json(format('{{\"id\": \"{0}\"}}', variables('azureFirewallSubnetId')))]",
"copy": [
{
"name": "azureFirewallIpConfigurations",
"count": 2,
"input": {
"name": "[concat('IpConf', copyIndex('azureFirewallIpConfigurations',1))]",
"properties": {
"subnet": "[if(equals(copyIndex('azureFirewallIpConfigurations',1), 1),
variables('azureFirewallSubnetJSON'), json('null'))]",
"publicIPAddress": {
"id": "[resourceId('Microsoft.Network/publicIPAddresses', concat(variables('publicIPAddress'),
copyIndex('azureFirewallIpConfigurations',1)))]"
}
}
}
}
]
},
"resources": [
{
"type": "Microsoft.Network/networkSecurityGroups",
"apiVersion": "2020-06-01",
"name": "[concat(variables('nsg_name'), copyIndex(1))]",
"location": "[parameters('location')]",
"copy": {
"name": "nsg-loop",
"count": 2
},
"properties": {
"securityRules": [
{
"name": "RDP",
"properties": {
"protocol": "TCP",
"sourcePortRange": "*",
"destinationPortRange": "3389",
"sourceAddressPrefix": "*",
"destinationAddressPrefix": "*",
"access": "Allow",
"priority": 300,
"direction": "Inbound"
}
}
]
}
},
},
{
"apiVersion": "2020-06-01",
"type": "Microsoft.Network/publicIPPrefixes",
"name": "[variables('ipprefix_name')]",
"location": "[parameters('location')]",
"properties": {
"prefixLength": "[variables('ipprefix_size')]",
"publicIPAddressVersion": "IPv4"
},
"sku": {
"name": "Standard",
"tier": "Regional"
}
},
{
"type": "Microsoft.Network/publicIPAddresses",
"apiVersion": "2020-06-01",
"name": "[concat(variables('publicIPAddress'), copyIndex(1))]",
"location": "[parameters('location')]",
"sku": {
"name": "Standard"
},
"copy": {
"name": "publicip-loop",
"count": 2
},
"dependsOn": [
"[resourceId('Microsoft.Network/publicIPPrefixes', variables('ipprefix_name'))]"
],
"properties": {
"publicIPAddressVersion": "IPv4",
"publicIPAllocationMethod": "Static",
"publicIPPrefix": {
"id": "[resourceId('Microsoft.Network/publicIPPrefixes',variables('ipprefix_name'))]"
},
"idleTimeoutInMinutes": 4
}
},
{
"type": "Microsoft.Network/virtualNetworks",
"apiVersion": "2020-06-01",
"name": "[variables('virtualNetworks_myVNet_name')]",
"location": "[parameters('location')]",
"dependsOn": [
"[resourceId('Microsoft.Network/routeTables', 'rt-01')]"
],
"properties": {
"addressSpace": {
"addressPrefixes": [
"[variables('vnet_prefix')]"
]
},
"subnets": [
{
"name": "myBackendSubnet",
"properties": {
"addressPrefix": "[variables('backend_subnet_prefix')]",
"routeTable": {
"id": "[resourceId('Microsoft.Network/routeTables', 'rt-01')]"
},
"privateEndpointNetworkPolicies": "Enabled",
"privateLinkServiceNetworkPolicies": "Enabled"
}
}
],
"enableDdosProtection": false,
"enableVmProtection": false
}
},
},
{
"type": "Microsoft.Network/virtualNetworks/subnets",
"apiVersion": "2020-06-01",
"name": "[concat(variables('virtualNetworks_myVNet_name'), '/AzureFirewallSubnet')]",
"dependsOn": [
"[resourceId('Microsoft.Network/virtualNetworks', variables('virtualNetworks_myVNet_name'))]"
],
"properties": {
"addressPrefix": "[variables('fw_subnet_prefix')]",
"privateEndpointNetworkPolicies": "Enabled",
"privateLinkServiceNetworkPolicies": "Enabled"
}
},
{
"type": "Microsoft.Compute/virtualMachines",
"apiVersion": "2020-06-01",
"name": "[concat(variables('virtualMachines_myVM_name'), copyIndex(1))]",
"location": "[parameters('location')]",
"copy": {
"name": "vm-loop",
"count": 2
},
"dependsOn": [
"[resourceId('Microsoft.Network/networkInterfaces', concat(variables('net_interface'), copyIndex(1)))]"
],
"properties": {
"hardwareProfile": {
"vmSize": "[parameters('vmSize')]"
},
"storageProfile": {
"imageReference": {
"publisher": "MicrosoftWindowsServer",
"offer": "WindowsServer",
"sku": "2019-Datacenter",
"version": "latest"
},
"osDisk": {
"osType": "Windows",
"createOption": "FromImage",
"caching": "ReadWrite",
"managedDisk": {
"storageAccountType": "StandardSSD_LRS"
},
"diskSizeGB": 127
}
},
"osProfile": {
"computerName": "[concat(variables('virtualMachines_myVM_name'), copyIndex(1))]",
"adminUsername": "[parameters('adminUsername')]",
"adminPassword": "[parameters('adminPassword')]",
"windowsConfiguration": {
"provisionVMAgent": true,
"enableAutomaticUpdates": true
},
"allowExtensionOperations": true
},
"networkProfile": {
"networkInterfaces": [
{
"id": "[resourceId('Microsoft.Network/networkInterfaces', concat(variables('net_interface'),
copyIndex(1)))]"
}
]
}
}
},
{
"type": "Microsoft.Network/networkInterfaces",
"apiVersion": "2020-06-01",
"name": "[concat(variables('net_interface'), copyIndex(1))]",
"location": "[parameters('location')]",
"copy": {
"name": "int-loop",
"count": 2
},
"dependsOn": [
"[resourceId('Microsoft.Network/virtualNetworks', variables('virtualNetworks_myVNet_name'))]",
"[resourceId('Microsoft.Network/networkSecurityGroups', concat(variables('nsg_name'), copyIndex(1)))]"
],
"properties": {
"ipConfigurations": [
{
"name": "[concat(variables('ipconfig_name'), copyIndex(1))]",
"properties": {
"subnet": {
"id": "[resourceId('Microsoft.Network/virtualNetworks/subnets',
variables('virtualNetworks_myVNet_name'), 'myBackendSubnet')]"
},
"primary": true
}
}
],
"enableAcceleratedNetworking": false,
"enableIPForwarding": false,
"networkSecurityGroup": {
"id": "[resourceId('Microsoft.Network/networkSecurityGroups', concat(variables('nsg_name'),
copyIndex(1)))]"
}
}
},
{
"type": "Microsoft.Network/azureFirewalls",
"apiVersion": "2020-06-01",
"name": "[variables('firewall_name')]",
"location": "[parameters('location')]",
"dependsOn": [
"[resourceId('Microsoft.Network/publicIPAddresses', concat(variables('publicIPAddress'), 1))]",
"[resourceId('Microsoft.Network/publicIPAddresses', concat(variables('publicIPAddress'), 2))]",
"[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('virtualNetworks_myVNet_name'),
'AzureFirewallSubnet')]"
],
"properties": {
"sku": {
"name": "AZFW_VNet",
"tier": "Standard"
},
"threatIntelMode": "Alert",
"ipConfigurations": "[variables('azureFirewallIpConfigurations')]",
"applicationRuleCollections": [
{
"name": "web",
"properties": {
"priority": 100,
"action": {
"type": "Allow"
},
"rules": [
{
"name": "wan-address",
"protocols": [
{
"protocolType": "Http",
"port": 80
},
{
"protocolType": "Https",
"port": 443
}
],
"targetFqdns": [
"getmywanip.com"
],
"sourceAddresses": [
"*"
]
},
{
"name": "google",
"protocols": [
{
"protocolType": "Http",
"port": 80
},
{
"protocolType": "Https",
"port": 443
}
],
"targetFqdns": [
"www.google.com"
],
"sourceAddresses": [
"10.0.1.0/24"
]
},
{
"name": "wupdate",
"protocols": [
{
"protocolType": "Http",
"port": 80
},
{
"protocolType": "Https",
"port": 443
}
],
"fqdnTags": [
"WindowsUpdate"
],
"sourceAddresses": [
"*"
]
}
]
}
}
],
"natRuleCollections": [
{
"name": "Coll-01",
"properties": {
"priority": 100,
"action": {
"type": "Dnat"
},
"rules": [
{
"name": "rdp-01",
"protocols": [
"TCP"
],
"translatedAddress": "10.0.1.4",
"translatedPort": "3389",
"sourceAddresses": [
"*"
"*"
],
"destinationAddresses": [ "[reference(resourceId('Microsoft.Network/publicIPAddresses/',
concat(variables('publicIPAddress'), 1))).ipAddress]" ],
"destinationPorts": [
"3389"
]
},
{
"name": "rdp-02",
"protocols": [
"TCP"
],
"translatedAddress": "10.0.1.5",
"translatedPort": "3389",
"sourceAddresses": [
"*"
],
"destinationAddresses": [ "[reference(resourceId('Microsoft.Network/publicIPAddresses/',
concat(variables('publicIPAddress'), 2))).ipAddress]" ],
"destinationPorts": [
"3389"
]
}
]
}
}
]
}
},
{
"type": "Microsoft.Network/routeTables",
"apiVersion": "2020-06-01",
"name": "rt-01",
"location": "[parameters('location')]",
"properties": {
"disableBgpRoutePropagation": false,
"routes": [
{
"name": "fw",
"properties": {
"addressPrefix": "0.0.0.0/0",
"nextHopType": "VirtualAppliance",
"nextHopIpAddress": "10.0.0.4"
}
}
]
}
}
]
}
2. In the portal, on the Create an Azure Firewall with multiple IP public addresses page, type or select
the following values:
Subscription: Select from existing subscriptions
Resource group: Select from existing resource groups or select Create new , and select OK .
Location: Select a location
Admin Username: Type username for the administrator user account
Admin Password: Type an administrator password or key
3. Select I agree to the terms and conditions stated above and then select Purchase . The deployment
can take 10 minutes or longer to complete.
Clean up resources
When you no longer need the resources that you created with the firewall, delete the resource group. This removes
the firewall and all the related resources.
To delete the resource group, call the Remove-AzResourceGroup cmdlet:
Next steps
Tutorial: Deploy and configure Azure Firewall in a hybrid network using the Azure portal
Quickstart: Deploy Azure Firewall with Availability
Zones - ARM template
10/25/2020 • 6 minutes to read • Edit Online
In this quickstart, you use an Azure Resource Manager template (ARM template) to deploy an Azure Firewall in
three Availability Zones.
An ARM template is a JavaScript Object Notation (JSON) file that defines the infrastructure and configuration for
your project. The template uses declarative syntax, which lets you state what you intend to deploy without having
to write the sequence of programming commands to create it.
The template creates a test network environment with a firewall. The network has one virtual network (VNet) with
three subnets: AzureFirewallSubnet, ServersSubnet, and JumpboxSubnet. The ServersSubnet and JumpboxSubnet
subnet each have a single, two-core Windows Server virtual machine.
The firewall is in the AzureFirewallSubnet subnet, and has an application rule collection with a single rule that
allows access to www.microsoft.com .
A user-defined route points network traffic from the ServersSubnet subnet through the firewall, where the firewall
rules are applied.
For more information about Azure Firewall, see Deploy and configure Azure Firewall using the Azure portal.
If your environment meets the prerequisites and you're familiar with using ARM templates, select the Deploy to
Azure button. The template will open in the Azure portal.
Prerequisites
An Azure account with an active subscription. Create an account for free.
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"virtualNetworkName": {
"type": "string",
"defaultValue": "test-vnet",
"metadata": {
"description": "virtual network name"
}
},
"adminUsername": {
"type": "string",
"metadata": {
"description": "Username for the Virtual Machine."
}
}
},
"adminPassword": {
"type": "securestring",
"metadata": {
"description": "Password for the Virtual Machine."
}
},
"location": {
"type": "string",
"defaultValue": "[resourceGroup().location]",
"metadata": {
"description": "Location for all resources."
}
},
"availabilityZones": {
"type": "array",
"defaultValue": [
"1",
"2",
"3"
],
"metadata": {
"description": "Zone numbers e.g. 1,2,3."
}
},
"numberOfFirewallPublicIPAddresses": {
"type": "int",
"defaultValue": 1,
"minValue": 1,
"maxValue": 100,
"metadata": {
"description": "Number of public IP addresses for the Azure Firewall"
}
},
"jumpBoxSize": {
"type": "string",
"defaultValue": "Standard_DS1_v2",
"metadata": {
"description": "Size of the virtual machine."
}
},
"serverSize": {
"type": "string",
"defaultValue": "Standard_DS1_v2",
"metadata": {
"description": "Size of the virtual machine."
}
}
},
"variables": {
"vnetAddressPrefix": "10.0.0.0/16",
"serversSubnetPrefix": "10.0.2.0/24",
"azureFirewallSubnetPrefix": "10.0.1.0/24",
"jumpboxSubnetPrefix": "10.0.0.0/24",
"nextHopIP": "10.0.1.4",
"azureFirewallSubnetName": "AzureFirewallSubnet",
"jumpBoxSubnetName": "JumpboxSubnet",
"serversSubnetName": "ServersSubnet",
"jumpBoxPublicIPAddressName": "JumpHostPublicIP",
"jumpBoxNsgName": "JumpHostNSG",
"jumpBoxNicName": "JumpHostNic",
"jumpBoxSubnetId": "[resourceId('Microsoft.Network/virtualNetworks/subnets',
parameters('virtualNetworkName'), variables('jumpBoxSubnetName'))]",
"serverNicName": "ServerNic",
"serverSubnetId": "[resourceId('Microsoft.Network/virtualNetworks/subnets',
parameters('virtualNetworkName'), variables('serversSubnetName'))]",
"storageAccountName": "[concat(uniquestring(resourceGroup().id), 'sajumpbox')]",
"azfwRouteTableName": "AzfwRouteTable",
"firewallName": "firewall1",
"firewallName": "firewall1",
"publicIPNamePrefix": "publicIP",
"azureFirewallSubnetId": "
[resourceId('Microsoft.Network/virtualNetworks/subnets',parameters('virtualNetworkName'),
variables('azureFirewallSubnetName'))]",
"azureFirewallSubnetJSON": "[json(format('{{\"id\": \"{0}\"}}', variables('azureFirewallSubnetId')))]",
"copy": [
{
"name": "azureFirewallIpConfigurations",
"count": "[parameters('numberOfFirewallPublicIPAddresses')]",
"input": {
"name": "[concat('IpConf', copyIndex('azureFirewallIpConfigurations'))]",
"properties": {
"subnet": "[if(equals(copyIndex('azureFirewallIpConfigurations'), 0),
variables('azureFirewallSubnetJSON'), json('null'))]",
"publicIPAddress": {
"id": "[resourceId('Microsoft.Network/publicIPAddresses',
concat(variables('publicIPNamePrefix'), add(copyIndex('azureFirewallIpConfigurations'), 1)))]"
}
}
}
}
],
"networkSecurityGroupName": "[concat(variables('serversSubnetName'), '-nsg')]"
},
"resources": [
{
"type": "Microsoft.Storage/storageAccounts",
"apiVersion": "2019-06-01",
"name": "[variables('storageAccountName')]",
"location": "[parameters('location')]",
"sku": {
"name": "Standard_LRS"
},
"kind": "Storage",
"properties": {}
},
{
"type": "Microsoft.Network/routeTables",
"apiVersion": "2020-06-01",
"name": "[variables('azfwRouteTableName')]",
"location": "[parameters('location')]",
"properties": {
"disableBgpRoutePropagation": false,
"routes": [
{
"name": "AzfwDefaultRoute",
"properties": {
"addressPrefix": "0.0.0.0/0",
"nextHopType": "VirtualAppliance",
"nextHopIpAddress": "[variables('nextHopIP')]"
}
}
]
}
},
{
"comments": "Simple Network Security Group for subnet [variables('serversSubnetName')]",
"type": "Microsoft.Network/networkSecurityGroups",
"apiVersion": "2020-06-01",
"name": "[variables('networkSecurityGroupName')]",
"location": "[parameters('location')]",
"properties": {}
},
{
"type": "Microsoft.Network/virtualNetworks",
"apiVersion": "2020-06-01",
"name": "[parameters('virtualNetworkName')]",
"location": "[parameters('location')]",
"dependsOn": [
"dependsOn": [
"[resourceId('Microsoft.Network/routeTables', variables('azfwRouteTableName'))]",
"[resourceId('Microsoft.Network/networkSecurityGroups', variables('networkSecurityGroupName'))]"
],
"tags": {
"displayName": "[parameters('virtualNetworkName')]"
},
"properties": {
"addressSpace": {
"addressPrefixes": [
"[variables('vnetAddressPrefix')]"
]
},
"subnets": [
{
"name": "[variables('jumpBoxSubnetName')]",
"properties": {
"addressPrefix": "[variables('jumpboxSubnetPrefix')]"
}
},
{
"name": "[variables('azureFirewallSubnetName')]",
"properties": {
"addressPrefix": "[variables('azureFirewallSubnetPrefix')]"
}
},
{
"name": "[variables('serversSubnetName')]",
"properties": {
"addressPrefix": "[variables('serversSubnetPrefix')]",
"routeTable": {
"id": "[resourceId('Microsoft.Network/routeTables', variables('azfwRouteTableName'))]"
},
"networkSecurityGroup": {
"id": "[resourceId('Microsoft.Network/networkSecurityGroups',
variables('networkSecurityGroupName'))]"
}
}
}
]
}
},
{
"type": "Microsoft.Network/publicIPAddresses",
"apiVersion": "2020-06-01",
"name": "[concat(variables('publicIPNamePrefix'), add(copyIndex(), 1))]",
"location": "[parameters('location')]",
"sku": {
"name": "Standard"
},
"copy": {
"name": "publicIpCopy",
"count": "[parameters('numberOfFirewallPublicIPAddresses')]"
},
"properties": {
"publicIPAllocationMethod": "Static",
"publicIPAddressVersion": "IPv4"
}
},
{
"type": "Microsoft.Network/publicIPAddresses",
"apiVersion": "2020-06-01",
"name": "[variables('jumpBoxPublicIPAddressName')]",
"location": "[parameters('location')]",
"properties": {
"publicIPAllocationMethod": "Dynamic"
}
},
{
"type": "Microsoft.Network/networkSecurityGroups",
"type": "Microsoft.Network/networkSecurityGroups",
"apiVersion": "2020-06-01",
"name": "[variables('jumpBoxNsgName')]",
"location": "[parameters('location')]",
"properties": {
"securityRules": [
{
"name": "myNetworkSecurityGroupRuleRDP",
"properties": {
"protocol": "Tcp",
"sourcePortRange": "*",
"destinationPortRange": "3389",
"sourceAddressPrefix": "*",
"destinationAddressPrefix": "*",
"access": "Allow",
"priority": 1000,
"direction": "Inbound"
}
}
]
}
},
{
"type": "Microsoft.Network/networkInterfaces",
"apiVersion": "2020-06-01",
"name": "[variables('JumpBoxNicName')]",
"location": "[parameters('location')]",
"dependsOn": [
"[resourceId('Microsoft.Network/publicIPAddresses/', variables('jumpBoxPublicIPAddressName'))]",
"[resourceId('Microsoft.Network/virtualNetworks/', parameters('virtualNetworkName'))]",
"[resourceId('Microsoft.Network/networkSecurityGroups', variables('jumpBoxNsgName'))]"
],
"properties": {
"ipConfigurations": [
{
"name": "ipconfig1",
"properties": {
"privateIPAllocationMethod": "Dynamic",
"publicIPAddress": {
"id": "
[resourceId('Microsoft.Network/publicIPAddresses',variables('jumpBoxPublicIPAddressName'))]"
},
"subnet": {
"id": "[variables('jumpBoxSubnetId')]"
}
}
}
],
"networkSecurityGroup": {
"id": "[resourceId('Microsoft.Network/networkSecurityGroups', variables('jumpBoxNsgName'))]"
}
}
},
{
"type": "Microsoft.Network/networkInterfaces",
"apiVersion": "2020-06-01",
"name": "[variables('ServerNicName')]",
"location": "[parameters('location')]",
"dependsOn": [
"[resourceId('Microsoft.Network/virtualNetworks/', parameters('virtualNetworkName'))]"
],
"properties": {
"ipConfigurations": [
{
"name": "ipconfig1",
"properties": {
"privateIPAllocationMethod": "Dynamic",
"subnet": {
"id": "[variables('serverSubnetId')]"
}
}
}
]
}
},
{
"type": "Microsoft.Compute/virtualMachines",
"apiVersion": "2020-06-01",
"name": "JumpBox",
"location": "[parameters('location')]",
"dependsOn": [
"[resourceId('Microsoft.Storage/storageAccounts/', variables('storageAccountName'))]",
"[resourceId('Microsoft.Network/networkInterfaces', variables('JumpBoxNicName'))]"
],
"properties": {
"hardwareProfile": {
"vmSize": "[parameters('jumpBoxSize')]"
},
"storageProfile": {
"imageReference": {
"publisher": "MicrosoftWindowsServer",
"offer": "WindowsServer",
"sku": "2019-Datacenter",
"version": "latest"
},
"osDisk": {
"osType": "Windows",
"createOption": "FromImage",
"diskSizeGB": 127
}
},
"osProfile": {
"computerName": "JumpBox",
"adminUsername": "[parameters('adminUsername')]",
"adminPassword": "[parameters('adminPassword')]"
},
"networkProfile": {
"networkInterfaces": [
{
"id": "[resourceId('Microsoft.Network/networkInterfaces', variables('JumpBoxNicName'))]"
}
]
},
"diagnosticsProfile": {
"bootDiagnostics": {
"enabled": true,
"storageUri": "[reference(resourceId('Microsoft.Storage/storageAccounts/',
variables('storageAccountName'))).primaryEndpoints.blob]"
}
}
}
},
{
"type": "Microsoft.Compute/virtualMachines",
"apiVersion": "2020-06-01",
"name": "Server",
"location": "[parameters('location')]",
"dependsOn": [
"[resourceId('Microsoft.Storage/storageAccounts/', variables('storageAccountName'))]",
"[resourceId('Microsoft.Network/networkInterfaces', variables('ServerNicName'))]"
],
"properties": {
"hardwareProfile": {
"vmSize": "[parameters('serverSize')]"
},
"storageProfile": {
"imageReference": {
"publisher": "MicrosoftWindowsServer",
"offer": "WindowsServer",
"sku": "2019-Datacenter",
"version": "latest"
},
"osDisk": {
"osType": "Windows",
"createOption": "FromImage",
"diskSizeGB": 127
}
},
"osProfile": {
"computerName": "Server",
"adminUsername": "[parameters('adminUsername')]",
"adminPassword": "[parameters('adminPassword')]"
},
"networkProfile": {
"networkInterfaces": [
{
"id": "[resourceId('Microsoft.Network/networkInterfaces', variables('ServerNicName'))]"
}
]
},
"diagnosticsProfile": {
"bootDiagnostics": {
"enabled": true,
"storageUri": "[reference(resourceId('Microsoft.Storage/storageAccounts/',
variables('storageAccountName'))).primaryEndpoints.blob]"
}
}
}
},
{
"type": "Microsoft.Network/azureFirewalls",
"apiVersion": "2020-06-01",
"name": "[variables('firewallName')]",
"location": "[parameters('location')]",
"zones": "[if(equals(length(parameters('availabilityZones')), 0), json('null'),
parameters('availabilityZones'))]",
"dependsOn": [
"[resourceId('Microsoft.Network/virtualNetworks', parameters('virtualNetworkName'))]",
"publicIpCopy"
],
"properties": {
"ipConfigurations": "[variables('azureFirewallIpConfigurations')]",
"applicationRuleCollections": [
{
"name": "appRc1",
"properties": {
"priority": 101,
"action": {
"type": "Allow"
},
"rules": [
{
"name": "appRule1",
"protocols": [
{
"port": 80,
"protocolType": "http"
},
{
"port": 443,
"protocolType": "https"
}
],
"targetFqdns": [
"www.microsoft.com"
],
"sourceAddresses": [
"sourceAddresses": [
"10.0.2.0/24"
]
}
]
}
}
],
"networkRuleCollections": [
{
"name": "netRc1",
"properties": {
"priority": 200,
"action": {
"type": "Allow"
},
"rules": [
{
"name": "netRule1",
"protocols": [
"TCP"
],
"sourceAddresses": [
"10.0.2.0/24"
],
"destinationAddresses": [
"*"
],
"destinationPorts": [
"8000-8999"
]
}
]
}
}
]
}
}
]
}
2. In the portal, on the Create a sandbox setup of Azure Firewall with Zones page, type or select the
following values:
Resource group : Select Create new , type a name for the resource group, and select OK .
Vir tual Network Name : Type a name for the new VNet.
Admin Username : Type a username for the administrator user account.
Admin Password : Type an administrator password.
3. Read the terms and conditions, and then select I agree to the terms and conditions stated above and
then select Purchase . The deployment can take 10 minutes or longer to complete.
Clean up resources
When you no longer need them, you can remove the resource group, firewall, and all related resources by running
the Remove-AzResourceGroup PowerShell command. To remove a resource group named MyResourceGroup, run:
Don't remove the resource group and firewall if you plan to continue on to the firewall monitoring tutorial.
Next steps
Next, you can monitor the Azure Firewall logs.
Tutorial: Monitor Azure Firewall logs
Tutorial: Deploy and configure Azure Firewall using
the Azure portal
10/25/2020 • 7 minutes to read • Edit Online
Controlling outbound network access is an important part of an overall network security plan. For example, you
may want to limit access to web sites. Or, you may want to limit the outbound IP addresses and ports that can be
accessed.
One way you can control outbound network access from an Azure subnet is with Azure Firewall. With Azure
Firewall, you can configure:
Application rules that define fully qualified domain names (FQDNs) that can be accessed from a subnet.
Network rules that define source address, protocol, destination port, and destination address.
Network traffic is subjected to the configured firewall rules when you route your network traffic to the firewall as
the subnet default gateway.
For this tutorial, you create a simplified single VNet with two subnets for easy deployment.
For production deployments, a hub and spoke model is recommended, where the firewall is in its own VNet. The
workload servers are in peered VNets in the same region with one or more subnets.
AzureFirewallSubnet - the firewall is in this subnet.
Workload-SN - the workload server is in this subnet. This subnet's network traffic goes through the firewall.
NOTE
The size of the AzureFirewallSubnet subnet is /26. For more information about the subnet size, see Azure Firewall FAQ.
1. On the Azure portal menu or from the Home page, select Create a resource .
2. Select Networking > Vir tual network .
3. For Subscription , select your subscription.
4. For Resource group , select Test-FW-RG .
5. For Name , type Test-FW-VN .
6. For Region , select the same location that you used previously.
7. Select Next: IP addresses .
8. For IPv4 Address space , type 10.0.0.0/16 .
9. Under Subnet , select default .
10. For Subnet name type AzureFirewallSubnet . The firewall will be in this subnet, and the subnet name must
be AzureFirewallSubnet.
11. For Address range , type 10.0.1.0/26 .
12. Select Save .
Next, create a subnet for the workload server.
1. Select Add subnet .
2. For Subnet name , type Workload-SN .
3. For Subnet address range , type 10.0.2.0/24 .
4. Select Add .
5. Select Review + create .
6. Select Create .
Create a virtual machine
Now create the workload virtual machine, and place it in the Workload-SN subnet.
1. On the Azure portal menu or from the Home page, select Create a resource .
2. Select Compute and then select Vir tual machine .
3. Windows Ser ver 2016 Datacenter in the Featured list.
4. Enter these values for the virtual machine:
SET T IN G VA L UE
SET T IN G VA L UE
Name Test-FW01
SET T IN G VA L UE
Clean up resources
You can keep your firewall resources for the next tutorial, or if no longer needed, delete the Test-FW-RG resource
group to delete all firewall-related resources.
Next steps
Tutorial: Monitor Azure Firewall logs
Tutorial: Deploy and configure Azure Firewall in a
hybrid network using the Azure portal
10/25/2020 • 13 minutes to read • Edit Online
When you connect your on-premises network to an Azure virtual network to create a hybrid network, the ability to
control access to your Azure network resources is an important part of an overall security plan.
You can use Azure Firewall to control network access in a hybrid network using rules that define allowed and
denied network traffic.
For this tutorial, you create three virtual networks:
VNet-Hub - the firewall is in this virtual network.
VNet-Spoke - the spoke virtual network represents the workload located on Azure.
VNet-Onprem - The on-premises virtual network represents an on-premises network. In an actual
deployment, it can be connected by either a VPN or ExpressRoute connection. For simplicity, this tutorial uses a
VPN gateway connection, and an Azure-located virtual network is used to represent an on-premises network.
Prerequisites
A hybrid network uses the hub-and-spoke architecture model to route traffic between Azure VNets and on-
premise networks. The hub-and-spoke architecture has the following requirements:
Set AllowGatewayTransit when peering VNet-Hub to VNet-Spoke. In a hub-and-spoke network
architecture, a gateway transit allows the spoke virtual networks to share the VPN gateway in the hub,
instead of deploying VPN gateways in every spoke virtual network.
Additionally, routes to the gateway-connected virtual networks or on-premises networks will automatically
propagate to the routing tables for the peered virtual networks using the gateway transit. For more
information, see Configure VPN gateway transit for virtual network peering.
Set UseRemoteGateways when you peer VNet-Spoke to VNet-Hub. If UseRemoteGateways is set and
AllowGatewayTransit on remote peering is also set, the spoke virtual network uses gateways of the
remote virtual network for transit.
To route the spoke subnet traffic through the hub firewall, you can use a User Defined route (UDR) that
points to the firewall with the Vir tual network gateway route propagation option disabled. The
Vir tual network gateway route propagation disabled option prevents route distribution to the spoke
subnets. This prevents learned routes from conflicting with your UDR. If you want to keep Vir tual network
gateway route propagation enabled, make sure to define specific routes to the firewall to override those
that are published from on-premises over BGP.
Configure a UDR on the hub gateway subnet that points to the firewall IP address as the next hop to the
spoke networks. No UDR is required on the Azure Firewall subnet, as it learns routes from BGP.
See the Create Routes section in this tutorial to see how these routes are created.
NOTE
Azure Firewall must have direct Internet connectivity. If your AzureFirewallSubnet learns a default route to your on-premises
network via BGP, you must override this with a 0.0.0.0/0 UDR with the NextHopType value set as Internet to maintain
direct Internet connectivity.
Azure Firewall can be configured to support forced tunneling. For more information, see Azure Firewall forced tunneling.
NOTE
Traffic between directly peered VNets is routed directly even if a UDR points to Azure Firewall as the default gateway. To send
subnet to subnet traffic to the firewall in this scenario, a UDR must contain the target subnet network prefix explicitly on
both subnets.
If you don't have an Azure subscription, create a free account before you begin.
SET T IN G VA L UE
Name AzFW01
Region East US
Set-AzVMExtension `
-ResourceGroupName FW-Hybrid-Test `
-ExtensionName IIS `
-VMName VM-Spoke-01 `
-Publisher Microsoft.Compute `
-ExtensionType CustomScriptExtension `
-TypeHandlerVersion 1.4 `
-SettingString '{"commandToExecute":"powershell Add-WindowsFeature Web-Server; powershell
Add-Content -Path \"C:\\inetpub\\wwwroot\\Default.htm\" -Value $($env:computername)"}' `
-Location EastUS
4. From the VM-Onprem virtual machine, open a remote desktop to VM-spoke-01 at the private IP address.
Your connection should succeed, and you should be able to sign in.
So now you've verified that the firewall rules are working:
You can browse web server on the spoke virtual network.
You can connect to the server on the spoke virtual network using RDP.
Next, change the firewall network rule collection action to Deny to verify that the firewall rules work as expected.
1. Select the AzFW01 firewall.
2. Select Rules .
3. Select the Network rule collection tab and select the RCNet01 rule collection.
4. For Action , select Deny .
5. Select Save .
Close any existing remote desktops before testing the changed rules. Now run the tests again. They should all fail
this time.
Clean up resources
You can keep your firewall resources for the next tutorial, or if no longer needed, delete the FW-Hybrid-Test
resource group to delete all firewall-related resources.
Next steps
Next, you can monitor the Azure Firewall logs.
Tutorial: Monitor Azure Firewall logs
Tutorial: Filter inbound Internet traffic with Azure
Firewall DNAT using the Azure portal
10/25/2020 • 5 minutes to read • Edit Online
You can configure Azure Firewall Destination Network Address Translation (DNAT) to translate and filter inbound
Internet traffic to your subnets. When you configure DNAT, the NAT rule collection action is set to Dnat . Each rule in
the NAT rule collection can then be used to translate your firewall public IP and port to a private IP and port. DNAT
rules implicitly add a corresponding network rule to allow the translated traffic. You can override this behavior by
explicitly adding a network rule collection with deny rules that match the translated traffic. To learn more about
Azure Firewall rule processing logic, see Azure Firewall rule processing logic.
In this tutorial, you learn how to:
Set up a test network environment
Deploy a firewall
Create a default route
Configure a DNAT rule
Test the firewall
Prerequisites
If you don't have an Azure subscription, create a free account before you begin.
NOTE
The size of the AzureFirewallSubnet subnet is /26. For more information about the subnet size, see Azure Firewall
FAQ.
SET T IN G VA L UE
Name FW-DNAT-test
Public IP address Create new . The Public IP address must be the Standard
SKU type.
Clean up resources
You can keep your firewall resources for the next tutorial, or if no longer needed, delete the RG-DNAT-Test
resource group to delete all firewall-related resources.
Next steps
In this tutorial, you learned how to:
Set up a test network environment
Deploy a firewall
Create a default route
Configure a DNAT rule
Test the firewall
Next, you can monitor the Azure Firewall logs.
Tutorial: Monitor Azure Firewall logs
Azure Firewall PowerShell samples
10/25/2020 • 2 minutes to read • Edit Online
The following table includes links to Azure PowerShell script samples that create firewalls:
SA M P L E DESC RIP T IO N
Create an Azure Firewall and test infrastructure Creates an Azure Firewall and a test network infrastructure.
Azure Firewall features
10/25/2020 • 4 minutes to read • Edit Online
Azure Firewall is a managed, cloud-based network security service that protects your Azure Virtual Network
resources..
Availability Zones
Azure Firewall can be configured during deployment to span multiple Availability Zones for increased availability.
With Availability Zones, your availability increases to 99.99% uptime. For more information, see the Azure Firewall
Service Level Agreement (SLA). The 99.99% uptime SLA is offered when two or more Availability Zones are
selected.
You can also associate Azure Firewall to a specific zone just for proximity reasons, using the service standard
99.95% SLA.
There's no additional cost for a firewall deployed in an Availability Zone. However, there are additional costs for
inbound and outbound data transfers associated with Availability Zones. For more information, see Bandwidth
pricing details.
Azure Firewall Availability Zones are available in regions that support Availability Zones. For more information, see
Regions that support Availability Zones in Azure
NOTE
Availability Zones can only be configured during deployment. You can't configure an existing firewall to include Availability
Zones.
For more information about Availability Zones, see Regions and Availability Zones in Azure
FQDN tags
FQDN tags make it easy for you to allow well-known Azure service network traffic through your firewall. For
example, say you want to allow Windows Update network traffic through your firewall. You create an application
rule and include the Windows Update tag. Now network traffic from Windows Update can flow through your
firewall.
Service tags
A service tag represents a group of IP address prefixes to help minimize complexity for security rule creation. You
can't create your own service tag, nor specify which IP addresses are included within a tag. Microsoft manages the
address prefixes encompassed by the service tag, and automatically updates the service tag as addresses change.
Threat intelligence
Threat intelligence-based filtering can be enabled for your firewall to alert and deny traffic from/to known
malicious IP addresses and domains. The IP addresses and domains are sourced from the Microsoft Threat
Intelligence feed.
Forced tunneling
You can configure Azure Firewall to route all Internet-bound traffic to a designated next hop instead of going
directly to the Internet. For example, you may have an on-premises edge firewall or other network virtual appliance
(NVA) to process network traffic before it's passed to the Internet. For more information, see Azure Firewall forced
tunneling.
Certifications
Azure Firewall is Payment Card Industry (PCI), Service Organization Controls (SOC), International Organization for
Standardization (ISO), and ICSA Labs compliant. For more information, see Azure Firewall compliance certifications.
Next steps
Azure Firewall rule processing logic
FQDN tags overview
10/25/2020 • 2 minutes to read • Edit Online
An FQDN tag represents a group of fully qualified domain names (FQDNs) associated with well known Microsoft
services. You can use an FQDN tag in application rules to allow the required outbound network traffic through your
firewall.
For example, to manually allow Windows Update network traffic through your firewall, you need to create multiple
application rules per the Microsoft documentation. Using FQDN tags, you can create an application rule, include
the Windows Updates tag, and now network traffic to Microsoft Windows Update endpoints can flow through
your firewall.
You can't create your own FQDN tags, nor can you specify which FQDNs are included within a tag. Microsoft
manages the FQDNs encompassed by the FQDN tag, and updates the tag as FQDNs change.
The following table shows the current FQDN tags you can use. Microsoft maintains these tags and you can expect
additional tags to be added periodically.
App Service Environment (ASE) Allows outbound access to ASE platform traffic. This tag
doesn’t cover customer-specific Storage and SQL endpoints
created by ASE. These should be enabled via Service Endpoints
or added manually.
Azure HDInsight Allows outbound access for HDInsight platform traffic. This tag
doesn’t cover customer-specific Storage or SQL traffic from
HDInsight. Enable these using Service Endpoints or add them
manually.
Azure Kubernetes Service (AKS) Allows outbound access to AKS. For more information, see
Use Azure Firewall to protect Azure Kubernetes Service (AKS)
Deployments.
NOTE
When selecting FQDN Tag in an application rule, the protocol:port field must be set to https .
Next steps
To learn how to deploy an Azure Firewall, see Tutorial: Deploy and configure Azure Firewall using the Azure portal.
Infrastructure FQDNs
11/18/2019 • 2 minutes to read • Edit Online
Azure Firewall includes a built-in rule collection for infrastructure FQDNs that are allowed by default. These FQDNs
are specific for the platform and can't be used for other purposes.
The following services are included in the built-in rule collection:
Compute access to storage Platform Image Repository (PIR)
Managed disks status storage access
Azure Diagnostics and Logging (MDS)
Overriding
You can override this built-in infrastructure rule collection by creating a deny all application rule collection that is
processed last. It will always be processed before the infrastructure rule collection. Anything not in the
infrastructure rule collection is denied by default.
Next steps
Learn how to deploy and configure an Azure Firewall.
Azure Firewall logs and metrics
10/25/2020 • 5 minutes to read • Edit Online
You can monitor Azure Firewall using firewall logs. You can also use activity logs to audit operations on Azure
Firewall resources.
You can access some of these logs through the portal. Logs can be sent to Azure Monitor logs, Storage, and Event
Hubs and analyzed in Azure Monitor logs or by different tools such as Excel and Power BI.
Metrics are lightweight and can support near real-time scenarios making them useful for alerting and fast issue
detection.
Diagnostic logs
The following diagnostic logs are available for Azure Firewall:
Application rule log
The Application rule log is saved to a storage account, streamed to Event hubs and/or sent to Azure Monitor
logs only if you've enabled it for each Azure Firewall. Each new connection that matches one of your
configured application rules results in a log for the accepted/denied connection. The data is logged in JSON
format, as shown in the following example:
{
"category": "AzureFirewallApplicationRule",
"time": "2018-04-16T23:45:04.8295030Z",
"resourceId":
"/SUBSCRIPTIONS/{subscriptionId}/RESOURCEGROUPS/{resourceGroupName}/PROVIDERS/MICROSOFT.NETWORK/AZUREFI
REWALLS/{resourceName}",
"operationName": "AzureFirewallApplicationRuleLog",
"properties": {
"msg": "HTTPS request from 10.1.0.5:55640 to mydestination.com:443. Action: Allow. Rule
Collection: collection1000. Rule: rule1002"
}
}
{
"category": "AzureFirewallNetworkRule",
"time": "2018-06-14T23:44:11.0590400Z",
"resourceId":
"/SUBSCRIPTIONS/{subscriptionId}/RESOURCEGROUPS/{resourceGroupName}/PROVIDERS/MICROSOFT.NETWORK/AZUREFI
REWALLS/{resourceName}",
"operationName": "AzureFirewallNetworkRuleLog",
"properties": {
"msg": "TCP request from 111.35.136.173:12518 to 13.78.143.217:2323. Action: Deny"
}
}
Success:
{
"category": "AzureFirewallDnsProxy",
"time": "2020-09-02T19:12:33.751Z",
"resourceId":
"/SUBSCRIPTIONS/{subscriptionId}/RESOURCEGROUPS/{resourceGroupName}/PROVIDERS/MICROSOFT.NETWORK/AZUREFI
REWALLS/{resourceName}",
"operationName": "AzureFirewallDnsProxyLog",
"properties": {
"msg": "DNS Request: 11.5.0.7:48197 – 15676 AAA IN md-l1l1pg5lcmkq.blob.core.windows.net. udp 55
false 512 NOERROR - 0 2.000301956s"
}
}
Failed:
{
"category": "AzureFirewallDnsProxy",
"time": "2020-09-02T19:12:33.751Z",
"resourceId":
"/SUBSCRIPTIONS/{subscriptionId}/RESOURCEGROUPS/{resourceGroupName}/PROVIDERS/MICROSOFT.NETWORK/AZUREFI
REWALLS/{resourceName}",
"operationName": "AzureFirewallDnsProxyLog",
"properties": {
"msg": " Error: 2 time.windows.com.reddog.microsoft.com. A: read udp 10.0.1.5:49126-
>168.63.129.160:53: i/o timeout”
}
}
msg format:
[client’s IP address]:[client’s port] – [query ID] [type of the request] [class of the request] [name of
the request] [protocol used] [request size in bytes] [EDNS0 DO (DNSSEC OK) bit set in the query] [EDNS0
buffer size advertised in the query] [response CODE] [response flags] [response size] [response
duration]
Activity logs
Activity log entries are collected by default, and you can view them in the Azure portal.
You can use Azure activity logs (formerly known as operational logs and audit logs) to view all operations
submitted to your Azure subscription.
Metrics
Metrics in Azure Monitor are numerical values that describe some aspect of a system at a particular time. Metrics
are collected every minute, and are useful for alerting because they can be sampled frequently. An alert can be
fired quickly with relatively simple logic.
The following metrics are available for Azure Firewall:
Application rules hit count - The number of times an application rule has been hit.
Unit: count
Network rules hit count - The number of times a network rule has been hit.
Unit: count
Data processed - Sum of data traversing the firewall in a given time window.
Unit: bytes
Throughput - Rate of data traversing the firewall per second.
Unit: bits per second
Firewall health state - Indicates the health of the firewall based on SNAT port availability.
Unit: percent
This metric has two dimensions:
Status: Possible values are Healthy, Degraded, Unhealthy.
Reason: Indicates the reason for the corresponding status of the firewall.
If SNAT ports are used > 95%, they are considered exhausted and the health is 50% with
status=Degraded and reason=SNAT por t . The firewall keeps processing traffic and existing
connections are not affected. However, new connections may not be established intermittently.
If SNAT ports are used < 95%, then firewall is considered healthy and health is shown as 100%.
If no SNAT ports usage is reported, health is shown as 0%.
SNAT por t utilization - The percentage of SNAT ports that have been utilized by the firewall.
Unit: percent
When you add more public IP addresses to your firewall, more SNAT ports are available, reducing the SNAT
ports utilization. Additionally, when the firewall scales out for different reasons (for example, CPU or
throughput) additional SNAT ports also become available. So effectively, a given percentage of SNAT ports
utilization may go down without you adding any public IP addresses, just because the service scaled out.
You can directly control the number of public IP addresses available to increase the ports available on your
firewall. But, you can't directly control firewall scaling.
Next steps
To learn how to monitor Azure Firewall logs and metrics, see Tutorial: Monitor Azure Firewall logs.
To learn more about metrics in Azure Monitor, see Metrics in Azure Monitor.
Azure Firewall threat intelligence-based filtering
5/19/2020 • 2 minutes to read • Edit Online
Threat intelligence-based filtering can be enabled for your firewall to alert and deny traffic from/to known
malicious IP addresses and domains. The IP addresses and domains are sourced from the Microsoft Threat
Intelligence feed. Intelligent Security Graph powers Microsoft threat intelligence and is used by multiple services
including Azure Security Center.
If you've enabled threat intelligence-based filtering, the associated rules are processed before any of the NAT rules,
network rules, or application rules.
You can choose to just log an alert when a rule is triggered, or you can choose alert and deny mode.
By default, threat intelligence-based filtering is enabled in alert mode. You can’t turn off this feature or change the
mode until the portal interface becomes available in your region.
Logs
The following log excerpt shows a triggered rule:
{
"category": "AzureFirewallNetworkRule",
"time": "2018-04-16T23:45:04.8295030Z",
"resourceId":
"/SUBSCRIPTIONS/{subscriptionId}/RESOURCEGROUPS/{resourceGroupName}/PROVIDERS/MICROSOFT.NETWORK/AZUREFIREWALLS
/{resourceName}",
"operationName": "AzureFirewallThreatIntelLog",
"properties": {
"msg": "HTTP request from 10.0.0.5:54074 to somemaliciousdomain.com:80. Action: Alert. ThreatIntel:
Bot Networks"
}
}
Testing
Outbound testing - Outbound traffic alerts should be a rare occurrence, as it means that your
environment has been compromised. To help test outbound alerts are working, a test FQDN has been
created that triggers an alert. Use testmaliciousdomain.eastus.cloudapp.azure.com for your outbound
tests.
Inbound testing - You can expect to see alerts on incoming traffic if DNAT rules are configured on the
firewall. This is true even if only specific sources are allowed on the DNAT rule and traffic is otherwise
denied. Azure Firewall doesn't alert on all known port scanners; only on scanners that are known to also
engage in malicious activity.
Next steps
See Azure Firewall Log Analytics samples
Learn how to deploy and configure an Azure Firewall
Review the Microsoft Security intelligence report
Configure Azure Firewall rules
10/25/2020 • 2 minutes to read • Edit Online
You can configure NAT rules, network rules, and applications rules on Azure Firewall. Rule collections are
processed according to the rule type in priority order, lower numbers to higher numbers from 100 to 65,000. A
rule collection name can have only letters, numbers, underscores, periods, or hyphens. It must begin with a letter
or number, and end with a letter, number or underscore. The maximum name length is 80 characters.
It's best to initially space your rule collection priority numbers in 100 increments (100, 200, 300, and so on) so you
have room to add more rule collections if needed.
NOTE
If you enable threat intelligence-based filtering, those rules are highest priority and are always processed first. Threat-
intelligence filtering may deny traffic before any configured rules are processed. For more information, see Azure Firewall
threat intelligence-based filtering.
Outbound connectivity
Network rules and applications rules
If you configure network rules and application rules, then network rules are applied in priority order before
application rules. The rules are terminating. So if a match is found in a network rule, no other rules are processed.
If there is no network rule match, and if the protocol is HTTP, HTTPS, or MSSQL, then the packet is then evaluated
by the application rules in priority order. If still no match is found, then the packet is evaluated against the
infrastructure rule collection. If there is still no match, then the packet is denied by default.
Inbound connectivity
NAT rules
Inbound Internet connectivity can be enabled by configuring Destination Network Address Translation (DNAT) as
described in Tutorial: Filter inbound traffic with Azure Firewall DNAT using the Azure portal. NAT rules are applied
in priority before network rules. If a match is found, an implicit corresponding network rule to allow the translated
traffic is added. You can override this behavior by explicitly adding a network rule collection with deny rules that
match the translated traffic.
Application rules aren't applied for inbound connections. So if you want to filter inbound HTTP/S traffic, you
should use Web Application Firewall (WAF). For more information, see What is Azure Web Application Firewall?
Examples
The following examples show the results of some of these rule combinations.
Example 1
Connection to google.com is allowed because of a matching network rule.
Network rule
Action: Allow
DEST IN AT IO N DEST IN AT IO N DEST IN AT IO N
NAME P ROTO C O L SO URC E T Y P E SO URC E TYPE A DDRESS P O RT S
Application rule
Action: Deny
Result
The connection to google.com is allowed because the packet matches the Allow-web network rule. Rule processing
stops at this point.
Example 2
SSH traffic is denied because a higher priority Deny network rule collection blocks it.
Network rule collection 1
Name: Allow-collection
Priority: 200
Action: Allow
Result
SSH connections are denied because a higher priority network rule collection blocks it. Rule processing stops at
this point.
Rule changes
If you change a rule to deny previously allowed traffic, any relevant existing sessions are dropped.
Next steps
Learn how to deploy and configure an Azure Firewall.
Azure Firewall service tags
11/18/2019 • 2 minutes to read • Edit Online
A service tag represents a group of IP address prefixes to help minimize complexity for security rule creation. You
cannot create your own service tag, nor specify which IP addresses are included within a tag. Microsoft manages
the address prefixes encompassed by the service tag, and automatically updates the service tag as addresses
change.
Azure Firewall service tags can be used in the network rules destination field. You can use them in place of specific
IP addresses.
Next steps
To learn more about Azure Firewall rules, see Azure Firewall rule processing logic.
IP Groups in Azure Firewall
10/25/2020 • 2 minutes to read • Edit Online
IP Groups allow you to group and manage IP addresses for Azure Firewall rules in the following ways:
As a source address in DNAT rules
As a source or destination address in network rules
As a source address in application rules
An IP Group can have a single IP address, multiple IP addresses, or one or more IP address ranges.
IP Groups can be reused in Azure Firewall DNAT, network, and application rules for multiple firewalls across
regions and subscriptions in Azure. Group names must be unique. You can configure an IP Group in the Azure
portal, Azure CLI, or REST API. A sample template is provided to help you get started.
Sample format
The following IPv4 address format examples are valid to use in IP Groups:
Single address: 10.0.0.0
CIDR notation: 10.1.0.0/32
Address range: 10.2.0.0-10.2.0.31
Create an IP Group
An IP Group can be created using the Azure portal, Azure CLI, or REST API. For more information, see Create an IP
Group.
Browse IP Groups
1. In the Azure portal search bar, type IP Groups and select it. You can see the list of the IP Groups, or you can
select Add to create a new IP Group.
2. Select an IP Group to open the overview page. You can edit, add, or delete IP addresses or IP Groups.
Manage an IP Group
You can see all the IP addresses in the IP Group and the rules or resources that are associated with it. To delete an IP
Group, you must first dissociate the IP Group from the resource that is using it.
1. To view or edit the IP addresses, select IP Addresses under Settings on the left pane.
2. To add a single or multiple IP address(es), select Add IP Addresses . This opens the Drag or Browse page for
an upload, or you can enter the address manually.
3. Selecting the ellipses (… ) to the right to edit or delete IP addresses. To edit or delete multiple IP addresses, select
the boxes and select Edit or Delete at the top.
4. Finally, can export the file in the CSV file format.
NOTE
If you delete all the IP addresses in an IP Group while it is still in use in a rule, that rule is skipped.
Use an IP Group
You can now select IP Group as a Source type or Destination type for the IP address(es) when you create Azure
Firewall DNAT, application, or network rules.
Region availability
IP Groups are available in all public cloud regions.
IP address limits
You can have a maximum of 100 IP Groups per firewall with a maximum 5000 individual IP addresses or IP prefixes
per each IP Group.
Next steps
Learn how to deploy and configure an Azure Firewall.
Azure Firewall forced tunneling
10/25/2020 • 2 minutes to read • Edit Online
When you configure a new Azure Firewall, you can route all Internet-bound traffic to a designated next hop instead
of going directly to the Internet. For example, you may have an on-premises edge firewall or other network virtual
appliance (NVA) to process network traffic before it's passed to the Internet. However, you can't configure an
existing firewall for forced tunneling.
By default, forced tunneling isn't allowed on Azure Firewall to ensure all its outbound Azure dependencies are met.
User Defined Route (UDR) configurations on the AzureFirewallSubnet that have a default route not going directly
to the Internet are disabled.
If you enable forced tunneling, Internet-bound traffic is SNATed to one of the firewall private IP addresses in
AzureFirewallSubnet, hiding the source from your on-premises firewall.
If your organization uses a public IP address range for private networks, Azure Firewall SNATs the traffic to one of
the firewall private IP addresses in AzureFirewallSubnet. However, you can configure Azure Firewall to not SNAT
your public IP address range. For more information, see Azure Firewall SNAT private IP address ranges.
Once you configure Azure Firewall to support forced tunneling, you can't undo the configuration. If you remove all
other IP configurations on your firewall, the management IP configuration is removed as well and the firewall is
deallocated. The public IP address assigned to the management IP configuration can't be removed, but you can
assign a different public IP address.
Next steps
Tutorial: Deploy and configure Azure Firewall in a hybrid network using the Azure portal
Azure Firewall certifications
10/25/2020 • 2 minutes to read • Edit Online
Azure Firewall is Payment Card Industry (PCI), Service Organization Controls (SOC), International Organization for
Standardization (ISO), ICSA Labs, and HITRUST compliant.
The following certifications are for global Azure and Azure Government.
ICSA Labs is a leading vendor in third-party testing and certification of security and health IT products, as well as
network-connected devices. They measure product compliance, reliability, and performance for most of the world’s
top technology vendors.
Azure Firewall is the first cloud firewall service to attain the ICSA Labs Corporate Firewall Certification. For the
Azure Firewall certification report, see the ICSA Labs Certification Testing and Audit Report. For more information,
see the ICSA Labs Firewall Certification Program page.
Next steps
For more information about Microsoft compliance, see the following information.
Microsoft Compliance Guide
Overview of Microsoft Azure compliance
Azure Firewall central management
10/25/2020 • 2 minutes to read • Edit Online
If you manage multiple firewalls, you know that continuously changing firewall rules make it difficult to keep them
in sync. Central IT teams need a way to define base firewall policies and enforce them across multiple business
units. At the same time, DevOps teams want to create their own local derived firewall policies for better agility.
Azure Firewall Manager can help solve these problems.
Next steps
For more information about Azure Firewall Manager, see What is Azure Firewall Manager?
Azure Firewall remote work support
10/25/2020 • 2 minutes to read • Edit Online
Azure Firewall is a managed, cloud-based network security service that protects your Azure virtual network
resources. It's a fully stateful firewall as a service with built-in high availability and unrestricted cloud scalability.
Next steps
Learn more about Windows Virtual Desktop.
Use FQDN filtering in network rules (preview)
10/25/2020 • 2 minutes to read • Edit Online
IMPORTANT
FQDN filtering in network rules is currently in public preview. This preview version is provided without a service level
agreement, and it's not recommended for production workloads. Certain features might not be supported or might have
constrained capabilities. For more information, see Supplemental Terms of Use for Microsoft Azure Previews.
A fully qualified domain name (FQDN) represents a domain name of a host or IP address(es). You can use FQDNs in
network rules based on DNS resolution in Azure Firewall and Firewall policy. This capability allows you to filter
outbound traffic with any TCP/UDP protocol (including NTP, SSH, RDP, and more). You must enable DNS Proxy to
use FQDNs in your network rules. For more information see Azure Firewall DNS settings (preview).
NOTE
By design, FQDN filtering doesn't support wildcards.
How it works
Once you define which DNS server your organization needs (Azure DNS or your own custom DNS), Azure Firewall
translates the FQDN to an IP address(es) based on the selected DNS server. This translation happens for both
application and network rule processing.
What’s the difference between using domain names in application rules compared to that of network rules?
FQDN filtering in application rules for HTTP/S and MSSQL is based on an application level transparent proxy
and the SNI header. As such, it can discern between two FQDNs that are resolved to the same IP address. This is
not the case with FQDN filtering in network rules. Always use application rules when possible.
In application rules, you can use HTTP/S and MSSQL as your selected protocols. In network rules, you can use
any TCP/UDP protocol with your destination FQDNs.
Next steps
Azure Firewall DNS settings
Azure security baseline for Azure Firewall
10/25/2020 • 22 minutes to read • Edit Online
This security baseline applies guidance from the Azure Security Benchmark to Azure Firewall. The Azure Security
Benchmark provides recommendations on how you can secure your cloud solutions on Azure. The content is
grouped the security controls defined by the Azure Security Benchmark and the related guidance applicable to
Azure Firewall. Controls not applicable to Azure Firewall have been excluded. To see how Azure Firewall
completely maps to the Azure Security Benchmark, see the full Azure Firewall security baseline mapping file.
Network security
For more information, see the Azure Security Benchmark: Network security.
1.2: Monitor and log the configuration and traffic of virtual networks, subnets, and network interfaces
Guidance : Azure Firewall is integrated with Azure Monitor for logging of traffic processed by the firewall.
Additionally, use Azure Security Center and follow network protection recommendations to help secure your
network resources related to Azure Firewall.
Understand Network Security provided by Azure Security Center
Azure Security Center monitoring : Yes
Responsibility : Customer
1.4: Deny communications with known-malicious IP addresses
Guidance : Enable Threat intelligence-based filtering to alert and deny traffic from/to known malicious IP addresses
and domains. Threat intelligence-based filtering can be enabled for your firewall to alert and deny traffic from/to-
known malicious IP addresses and domains.
Azure Firewall threat intelligence-based filtering
Understand Azure Security Center Integrated Threat Intelligence
Azure Security Center monitoring : Yes
Responsibility : Customer
1.8: Minimize complexity and administrative overhead of network security rules
Guidance : In an Azure Firewall, a service tag represents a group of IP address prefixes to help minimize complexity
for security rule creation.
Azure Firewall service tags can be used in the network rules destination field and define network access controls on
Azure Firewall. You can use service tags in place of specific IP addresses when creating security rules.
Additionally, customer-defined tags such as IP groups are also supported and can be used in a network rule or an
application rule. FQDN tags in application rules are supported to allow the required outbound network traffic
through your firewall.
Note that you cannot create your own service tag, nor specify which IP addresses are included within a tag.
Microsoft manages the address prefixes encompassed by the service tag, and automatically updates the service tag
as addresses change.
Azure Firewall service tags
Available service tags
IP groups in Azure Firewall
FQDN tags overview
Azure Security Center monitoring : Currently not available
Responsibility : Customer
1.9: Maintain standard security configurations for network devices
Guidance : Azure policy is not yet fully supported for Azure Firewall. Azure Firewall Manager can be used to
achieve standardization of security configurations.
You may also use Azure Blueprints to simplify large-scale Azure deployments by packaging key environment
artifacts, such as Azure Resources Manager templates, Azure RBAC controls, and policies, in a single blueprint
definition. You can apply the blueprint to new subscriptions, and fine-tune control and management through
versioning.
How to configure and manage Azure Policy
Azure Policy samples for networking
How to create an Azure Blueprint
Azure Security Center monitoring : Not applicable
Responsibility : Customer
1.11: Use automated tools to monitor network resource configurations and detect changes
Guidance : Use Azure Activity Log to monitor resource configurations and detect changes to your Azure Firewall
resources. Create alerts within Azure Monitor that will trigger when changes to critical resources take place.
Monitor Azure Firewall logs and metrics
How to view and retrieve Azure Activity Log events
How to create alerts in Azure Monitor
Azure Security Center monitoring : Yes
Responsibility : Customer
Data protection
For more information, see the Azure Security Benchmark: Data protection.
4.1: Maintain an inventory of sensitive Information
Guidance : Use tags to assist in tracking Azure Firewall and related resources that store or process sensitive
information.
How to create and use tags
Azure Security Center monitoring : Currently not available
Responsibility : Customer
4.2: Isolate systems storing or processing sensitive information
Guidance : Implement isolation using separate subscriptions and management groups for individual security
domains such as environment type and data sensitivity level. You can restrict the level of access to your Azure
Firewall resources that your applications and enterprise environments demand. You can control access to Azure
resources via Azure role-based access control.
How to create additional Azure subscriptions
How to create Management Groups
How to create and use tags
Azure Security Center monitoring : Not applicable
Responsibility : Customer
4.3: Monitor and block unauthorized transfer of sensitive information
Guidance : Leverage a third-party solution from Azure Marketplace on network perimeters that monitors for
unauthorized transfer of sensitive information and blocks such transfers while alerting information security
professionals.
For the underlying platform which is managed by Microsoft, Microsoft treats all customer content as sensitive and
guard against customer data loss and exposure. To ensure customer data within Azure remains secure, Microsoft
has implemented and maintains a suite of robust data protection controls and capabilities.
Understand customer data protection in Azure
Azure Security Center monitoring : Currently not available
Responsibility : Shared
4.4: Encrypt all sensitive information in transit
Guidance : Encrypt all sensitive information in transit. Ensure that any clients connecting to your Azure Firewall and
related resources are able to negotiate TLS 1.2 or greater.
Follow Azure Security Center recommendations for encryption at rest and encryption in transit, where applicable.
Understand encryption in transit with Azure
Azure Security Center monitoring : Yes
Responsibility : Shared
4.5: Use an active discovery tool to identify sensitive data
Guidance : Use a third-party active discovery tool to identify all sensitive information stored in Azure resource
using Azure Firewall and related resources and update the organization's sensitive information inventory.
Understand customer data protection in Azure
Azure Security Center monitoring : Currently not available
Responsibility : Shared
4.6: Use Azure RBAC to control access to resources
Guidance : Use Azure role-based access control (Azure RBAC) to control access to Azure Firewall and related
resources.
How to configure Azure RBAC
Azure Security Center monitoring : Currently not available
Responsibility : Customer
4.8: Encrypt sensitive information at rest
Guidance : Use encryption at rest on all Azure resources using Azure Firewall and related resources. Microsoft
recommends allowing Azure to manage your encryption keys, however there is the option for you to manage your
own keys in some instances.
Understand encryption at rest in Azure
How to configure customer managed encryption keys
Azure Security Center monitoring : Currently not available
Responsibility : Customer
4.9: Log and alert on changes to critical Azure resources
Guidance : Use Azure Monitor with the Azure Activity Log to create alerts for when changes take place in Azure
Firewall.
How to create alerts for Azure Activity Log events
Azure Security Center monitoring : Currently not available
Responsibility : Customer
Secure configuration
For more information, see the Azure Security Benchmark: Secure configuration.
7.1: Establish secure configurations for all Azure resources
Guidance : Azure Resource Manager has the ability to export the template in JavaScript Object Notation (JSON),
which should be reviewed to ensure that the configurations meet / exceed the security requirements for your
organization.
You can also use recommendations from Azure Security Center as a secure configuration baseline for your Azure
resources.
Azure policy is not fully supported at this time.
Single and multi-resource export to a template in Azure portal
Security recommendations - a reference guide
Azure Security Center monitoring : Not applicable
Responsibility : Customer
7.3: Maintain secure Azure resource configurations
Guidance : Use Azure policy [deny] and [deploy if not exist] to enforce secure settings across your Azure Firewall
and related resources. In addition, you may use Azure Resource Manager templates to maintain the security
configuration of your Azure Firewall and related resources required by your organization.
Understand Azure Policy effects
Create and manage policies to enforce compliance
Azure Resource Manager templates overview
Azure Security Center monitoring : Not applicable
Responsibility : Customer
7.5: Securely store configuration of Azure resources
Guidance : Use Azure DevOps to securely store and manage your code like custom Azure policies and Azure
Resource Manager templates. To access the resources you manage in Azure DevOps, you can grant or deny
permissions to specific users, built-in security groups, or groups defined in Azure Active Directory (Azure AD) if
integrated with Azure DevOps, or Active Directory if integrated with TFS.
How to store code in Azure DevOps
About permissions and groups in Azure DevOps
Azure Security Center monitoring : Not applicable
Responsibility : Customer
7.7: Deploy configuration management tools for Azure resources
Guidance : Define and implement standard security configurations for Azure Firewall and related resources using
Azure Policy. Use Azure Policy aliases to create custom policies to audit or enforce the network configuration of
your Azure Firewall resources. You may also make use of built-in policy definitions related to your specific
resources.
How to configure and manage Azure Policy
How to use Aliases
Azure Security Center monitoring : Not applicable
Responsibility : Customer
7.12: Manage identities securely and automatically
Guidance : Use Managed Identities to provide Azure services with an automatically managed identity in Azure AD.
Managed Identities allows you to authenticate to any service that supports Azure AD authentication to Azure
Resource Manager and can be used with API/Azure Portal/CLI/PowerShell.
How to configure Managed Identities
Azure Security Center monitoring : Currently not available
Responsibility : Customer
7.13: Eliminate unintended credential exposure
Guidance : Implement Credential Scanner to identify credentials within code. Credential Scanner will also
encourage moving discovered credentials to more secure locations such as Azure Key Vault.
How to setup Credential Scanner
Azure Security Center monitoring : Not applicable
Responsibility : Customer
Data recovery
For more information, see the Azure Security Benchmark: Data recovery.
9.1: Ensure regular automated back-ups
Guidance : Use Azure Resource Manager to export the Azure Firewall and related resources in a JavaScript Object
Notation (JSON) template which can be used as backup for Azure Firewall and related configurations. You can also
export Azure Firewall configuration using Export template feature of Azure Firewall from Azure portal. Use Azure
Automation to run the backup scripts automatically.
Single and multi-resource export to a template in Azure portal
Deploy Azure Firewall using a template
Microsoft Network Azure Firewalls template reference
About Azure Automation
Azure Security Center monitoring : Not applicable
Responsibility : Customer
9.2: Perform complete system backups and backup any customer-managed keys
Guidance : Use Azure Resource Manager to export the Azure Firewall and related resources in a JavaScript Object
Notation (JSON) template which can be used as backup for Azure Firewall and related configurations. You can also
export Azure Firewall configuration using Export template feature of Azure Firewall from Azure portal.
Deploy Azure Firewall using a template
Microsoft Network Azure Firewalls template reference
Azure Security Center monitoring : Not applicable
Responsibility : Customer
9.3: Validate all backups including customer-managed keys
Guidance : Ensure ability to periodically perform restoration using Azure Resource Manager template backed files.
Deploy Azure Firewall using a template
Microsoft Network Azure Firewalls template reference
Azure Security Center monitoring : Not applicable
Responsibility : Customer
9.4: Ensure protection of backups and customer-managed keys
Guidance : Use Azure DevOps to securely store and manage your code like custom Azure policies, Azure Resource
Manager templates. To protect resources you manage in Azure DevOps, you can grant or deny permissions to
specific users, built-in security groups, or groups defined in Azure Active Directory (Azure AD) if integrated with
Azure DevOps, or Active Directory if integrated with TFS.
How to store code in Azure DevOps
About permissions and groups in Azure DevOps
Azure Security Center monitoring : Not applicable
Responsibility : Customer
Incident response
For more information, see the Azure Security Benchmark: Incident response.
10.1: Create an incident response guide
Guidance : Build out an incident response guide for your organization. Ensure that there are written incident
response plans that define all roles of personnel as well as phases of incident handling/management from
detection to post-incident review.
Guidance on building your own security incident response process
Microsoft Security Response Center's Anatomy of an Incident
Leverage NIST's Computer Security Incident Handling Guide to aid in the creation of your own incident
response plan
Azure Security Center monitoring : Not applicable
Responsibility : Customer
10.2: Create an incident scoring and prioritization procedure
Guidance : Security Center assigns a severity to each alert to help you prioritize which alerts should be investigated
first. The severity is based on how confident Security Center is in the finding or the analytic used to issue the alert
as well as the confidence level that there was malicious intent behind the activity that led to the alert.
Additionally, clearly mark subscriptions (for ex. production, non-prod) using tags and create a naming system to
clearly identify and categorize Azure resources, especially those processing sensitive data. It is your responsibility to
prioritize the remediation of alerts based on the criticality of the Azure resources and environment where the
incident occurred.
Security alerts in Azure Security Center
Use tags to organize your Azure resources
Azure Security Center monitoring : Not applicable
Responsibility : Customer
10.3: Test security response procedures
Guidance : Conduct exercises to test your systems’ incident response capabilities on a regular cadence to help
protect your Azure resources. Identify weak points and gaps and revise plan as needed.
NIST's publication - Guide to Test, Training, and Exercise Programs for IT Plans and Capabilities
Azure Security Center monitoring : Not applicable
Responsibility : Customer
10.4: Provide security incident contact details and configure alert notifications for security incidents
Guidance : Security incident contact information will be used by Microsoft to contact you if the Microsoft Security
Response Center (MSRC) discovers that your data has been accessed by an unlawful or unauthorized party. Review
incidents after the fact to ensure that issues are resolved.
How to set the Azure Security Center Security Contact
Azure Security Center monitoring : Yes
Responsibility : Customer
10.5: Incorporate security alerts into your incident response system
Guidance : Export your Azure Security Center alerts and recommendations using the Continuous Export feature to
help identify risks to Azure resources.
Continuous Export allows you to export alerts and recommendations either manually or in an ongoing, continuous
fashion. You may use the Azure Security Center data connector to stream the alerts to Azure Sentinel.
How to configure continuous export
How to stream alerts into Azure Sentinel
Azure Security Center monitoring : Currently not available
Responsibility : Customer
10.6: Automate the response to security alerts
Guidance : Use the Workflow Automation feature in Azure Security Center to automatically trigger responses via
"Logic Apps" on security alerts and recommendations to protect your Azure resources.
How to configure Workflow Automation and Logic Apps
Azure Security Center monitoring : Currently not available
Responsibility : Customer
Next steps
See the Azure security benchmark
Learn more about Azure security baselines
Deploy and configure Azure Firewall using Azure
PowerShell
10/25/2020 • 5 minutes to read • Edit Online
Controlling outbound network access is an important part of an overall network security plan. For example, you
may want to limit access to web sites. Or, you may want to limit the outbound IP addresses and ports that can be
accessed.
One way you can control outbound network access from an Azure subnet is with Azure Firewall. With Azure
Firewall, you can configure:
Application rules that define fully qualified domain names (FQDNs) that can be accessed from a subnet.
Network rules that define source address, protocol, destination port, and destination address.
Network traffic is subjected to the configured firewall rules when you route your network traffic to the firewall as
the subnet default gateway.
For this article, you create a simplified single VNet with three subnets for easy deployment. For production
deployments, a hub and spoke model is recommended, where the firewall is in its own VNet. The workload servers
are in peered VNets in the same region with one or more subnets.
AzureFirewallSubnet - the firewall is in this subnet.
Workload-SN - the workload server is in this subnet. This subnet's network traffic goes through the firewall.
Jump-SN - The "jump" server is in this subnet. The jump server has a public IP address that you can connect to
using Remote Desktop. From there, you can then connect to (using another Remote Desktop) the workload
server.
Prerequisites
This procedure requires that you run PowerShell locally. You must have the Azure PowerShell module installed. Run
Get-Module -ListAvailable Az to find the version. If you need to upgrade, see Install Azure PowerShell module.
After you verify the PowerShell version, run Connect-AzAccount to create a connection with Azure.
Create a VNet
This virtual network has three subnets:
NOTE
The size of the AzureFirewallSubnet subnet is /26. For more information about the subnet size, see Azure Firewall FAQ.
New-AzVm `
-ResourceGroupName Test-FW-RG `
-Name "Srv-Jump" `
-Location "East US" `
-VirtualNetworkName Test-FW-VN `
-SubnetName Jump-SN `
-OpenPorts 3389 `
-Size "Standard_DS2"
Create a workload virtual machine with no public IP address. When prompted, type a user name and password for
the virtual machine.
#Create the NIC
$NIC = New-AzNetworkInterface -Name Srv-work -ResourceGroupName Test-FW-RG `
-Location "East US" -Subnetid $testVnet.Subnets[1].Id
$AzfwPrivateIP = $Azfw.IpConfigurations.privateipaddress
$AzfwPrivateIP
Note the private IP address. You'll use it later when you create the default route.
$routeTableDG = New-AzRouteTable `
-Name Firewall-rt-table `
-ResourceGroupName Test-FW-RG `
-location "East US" `
-DisableBgpRoutePropagation
#Create a route
Add-AzRouteConfig `
-Name "DG-Route" `
-RouteTable $routeTableDG `
-AddressPrefix 0.0.0.0/0 `
-NextHopType "VirtualAppliance" `
-NextHopIpAddress $AzfwPrivateIP `
| Set-AzRouteTable
Set-AzVirtualNetworkSubnetConfig `
-VirtualNetwork $testVnet `
-Name Workload-SN `
-AddressPrefix 10.0.2.0/24 `
-RouteTable $routeTableDG | Set-AzVirtualNetwork
Configure an application rule
The application rule allows outbound access to www.google.com.
$Azfw.ApplicationRuleCollections.Add($AppRuleCollection)
Azure Firewall includes a built-in rule collection for infrastructure FQDNs that are allowed by default. These FQDNs
are specific for the platform and can't be used for other purposes. For more information, see Infrastructure FQDNs.
$Azfw.NetworkRuleCollections.Add($NetRuleCollection)
Change the primary and secondary DNS address for the Srv-Work network interface
For testing purposes in this procedure, configure the server's primary and secondary DNS addresses. This isn't a
general Azure Firewall requirement.
$NIC.DnsSettings.DnsServers.Add("209.244.0.3")
$NIC.DnsSettings.DnsServers.Add("209.244.0.4")
$NIC | Set-AzNetworkInterface
$NIC.IpConfigurations.PrivateIpAddress
2. Connect a remote desktop to Sr v-Jump virtual machine, and sign in. From there, open a remote desktop
connection to the Sr v-Work private IP address and sign in.
3. On SRV-Work , open a PowerShell window and run the following commands:
nslookup www.google.com
nslookup www.microsoft.com
Both commands should return answers, showing that your DNS queries are getting through the firewall.
4. Run the following commands:
The www.google.com requests should succeed, and the www.microsoft.com requests should fail. This
demonstrates that your firewall rules are operating as expected.
So now you've verified that the firewall rules are working:
You can resolve DNS names using the configured external DNS server.
You can browse to the one allowed FQDN, but not to any others.
Clean up resources
You can keep your firewall resources for the next tutorial, or if no longer needed, delete the Test-FW-RG resource
group to delete all firewall-related resources:
Next steps
Tutorial: Monitor Azure Firewall logs
Deploy and configure Azure Firewall in a hybrid
network using Azure PowerShell
10/25/2020 • 11 minutes to read • Edit Online
When you connect your on-premises network to an Azure virtual network to create a hybrid network, the ability to
control access to your Azure network resources is an important part of an overall security plan.
You can use Azure Firewall to control network access in a hybrid network using rules that define allowed and
denied network traffic.
For this article, you create three virtual networks:
VNet-Hub - the firewall is in this virtual network.
VNet-Spoke - the spoke virtual network represents the workload located on Azure.
VNet-Onprem - The on-premises virtual network represents an on-premises network. In an actual
deployment, it can be connected by either a VPN or ExpressRoute connection. For simplicity, this article uses a
VPN gateway connection, and an Azure-located virtual network is used to represent an on-premises network.
Prerequisites
This article requires that you run PowerShell locally. You must have the Azure PowerShell module installed. Run
Get-Module -ListAvailable Az to find the version. If you need to upgrade, see Install Azure PowerShell module.
After you verify the PowerShell version, run Login-AzAccount to create a connection with Azure.
There are three key requirements for this scenario to work correctly:
A User Defined Route (UDR) on the spoke subnet that points to the Azure Firewall IP address as the default
gateway. Virtual network gateway route propagation must be Disabled on this route table.
A UDR on the hub gateway subnet must point to the firewall IP address as the next hop to the spoke
networks.
No UDR is required on the Azure Firewall subnet, as it learns routes from BGP.
Make sure to set AllowGatewayTransit when peering VNet-Hub to VNet-Spoke and
UseRemoteGateways when peering VNet-Spoke to VNet-Hub.
See the Create Routes section in this article to see how these routes are created.
NOTE
Azure Firewall must have direct Internet connectivity. If your AzureFirewallSubnet learns a default route to your on-premises
network via BGP, you must override this with a 0.0.0.0/0 UDR with the NextHopType value set as Internet to maintain
direct Internet connectivity.
Azure Firewall can be configured to support forced tunneling. For more information, see Azure Firewall forced tunneling.
NOTE
Traffic between directly peered VNets is routed directly even if a UDR points to Azure Firewall as the default gateway. To send
subnet to subnet traffic to the firewall in this scenario, a UDR must contain the target subnet network prefix explicitly on both
subnets.
To review the related Azure PowerShell reference documentation, see Azure PowerShell Reference.
If you don't have an Azure subscription, create a free account before you begin.
$VNetnameHub = "VNet-hub"
$SNnameHub = "AzureFirewallSubnet"
$VNetHubPrefix = "10.5.0.0/16"
$SNHubPrefix = "10.5.0.0/24"
$SNGWHubPrefix = "10.5.1.0/24"
$GWHubName = "GW-hub"
$GWHubpipName = "VNet-hub-GW-pip"
$GWIPconfNameHub = "GW-ipconf-hub"
$ConnectionNameHub = "hub-to-Onprem"
$VnetNameSpoke = "VNet-Spoke"
$SNnameSpoke = "SN-Workload"
$VNetSpokePrefix = "10.6.0.0/16"
$SNSpokePrefix = "10.6.0.0/24"
$SNSpokeGWPrefix = "10.6.1.0/24"
$VNetnameOnprem = "Vnet-Onprem"
$SNNameOnprem = "SN-Corp"
$VNetOnpremPrefix = "192.168.0.0/16"
$SNOnpremPrefix = "192.168.1.0/24"
$SNGWOnpremPrefix = "192.168.2.0/24"
$GWOnpremName = "GW-Onprem"
$GWIPconfNameOnprem = "GW-ipconf-Onprem"
$ConnectionNameOnprem = "Onprem-to-hub"
$GWOnprempipName = "VNet-Onprem-GW-pip"
$SNnameGW = "GatewaySubnet"
Request a public IP address to be allocated to the VPN gateway you'll create for your virtual network. Notice that
the AllocationMethod is Dynamic . You can't specify the IP address that you want to use. It's dynamically allocated
to your VPN gateway.
$gwpip1 = New-AzPublicIpAddress -Name $GWHubpipName -ResourceGroupName $RG1 `
-Location $Location1 -AllocationMethod Dynamic
Request a public IP address to be allocated to the gateway you'll create for the virtual network. Notice that the
AllocationMethod is Dynamic . You can't specify the IP address that you want to use. It's dynamically allocated to
your gateway.
$AzfwPrivateIP = $Azfw.IpConfigurations.privateipaddress
$AzfwPrivateIP
Now create the VPN gateway for the hub virtual network. Network-to-network configurations require a
RouteBased VpnType. Creating a VPN gateway can often take 45 minutes or more, depending on the selected VPN
gateway SKU.
Now create the VPN gateway for the on-premises virtual network. Network-to-network configurations require a
RouteBased VpnType. Creating a VPN gateway can often take 45 minutes or more, depending on the selected VPN
gateway SKU.
Create the on-premises to hub virtual network connection. This step is similar to the previous one, except you
create the connection from VNet-Onprem to VNet-hub. Make sure the shared keys match. The connection will be
established after a few minutes.
After the cmdlet finishes, view the values. In the following example, the connection status shows as Connected and
you can see ingress and egress bytes.
"connectionStatus": "Connected",
"ingressBytesTransferred": 33509044,
"egressBytesTransferred": 4142431
#Create a route
Get-AzRouteTable `
-ResourceGroupName $RG1 `
-Name UDR-Hub-Spoke `
| Add-AzRouteConfig `
-Name "ToSpoke" `
-AddressPrefix $VNetSpokePrefix `
-NextHopType "VirtualAppliance" `
-NextHopIpAddress $AzfwPrivateIP `
| Set-AzRouteTable
Set-AzVirtualNetworkSubnetConfig `
-VirtualNetwork $VNetHub `
-Name $SNnameGW `
-AddressPrefix $SNGWHubPrefix `
-RouteTable $routeTableHubSpoke | `
Set-AzVirtualNetwork
#Create a table, with BGP route propagation disabled. The property is now called "Virtual network gateway
route propagation," but the API still refers to the parameter as "DisableBgpRoutePropagation."
$routeTableSpokeDG = New-AzRouteTable `
-Name 'UDR-DG' `
-ResourceGroupName $RG1 `
-location $Location1 `
-DisableBgpRoutePropagation
#Create a route
Get-AzRouteTable `
-ResourceGroupName $RG1 `
-Name UDR-DG `
| Add-AzRouteConfig `
-Name "ToFirewall" `
-AddressPrefix 0.0.0.0/0 `
-NextHopType "VirtualAppliance" `
-NextHopIpAddress $AzfwPrivateIP `
| Set-AzRouteTable
Set-AzVirtualNetworkSubnetConfig `
-VirtualNetwork $VNetSpoke `
-Name $SNnameSpoke `
-AddressPrefix $SNSpokePrefix `
-RouteTable $routeTableSpokeDG | `
Set-AzVirtualNetwork
New-AzVm `
-ResourceGroupName $RG1 `
-Name "VM-Onprem" `
-Location $Location1 `
-VirtualNetworkName $VNetnameOnprem `
-SubnetName $SNNameOnprem `
-OpenPorts 3389 `
-Size "Standard_DS2"
$NIC.IpConfigurations.privateipaddress
$rcNet = $azfw.GetNetworkRuleCollectionByName("RCNet01")
$rcNet.action.type = "Deny"
Now run the tests again. They should all fail this time. Close any existing remote desktops before testing the
changed rules.
Clean up resources
You can keep your firewall resources for the next tutorial, or if no longer needed, delete the FW-Hybrid-Test
resource group to delete all firewall-related resources.
Next steps
Next, you can monitor the Azure Firewall logs.
Tutorial: Monitor Azure Firewall logs
Deploy and configure Azure Firewall using Azure CLI
10/25/2020 • 6 minutes to read • Edit Online
Controlling outbound network access is an important part of an overall network security plan. For example, you
may want to limit access to web sites. Or, you may want to limit the outbound IP addresses and ports that can be
accessed.
One way you can control outbound network access from an Azure subnet is with Azure Firewall. With Azure
Firewall, you can configure:
Application rules that define fully qualified domain names (FQDNs) that can be accessed from a subnet. The
FQDN can also include SQL instances.
Network rules that define source address, protocol, destination port, and destination address.
Network traffic is subjected to the configured firewall rules when you route your network traffic to the firewall as
the subnet default gateway.
For this article, you create a simplified single VNet with three subnets for easy deployment. For production
deployments, a hub and spoke model is recommended. The firewall is in its own VNet. The workload servers are in
peered VNets in the same region with one or more subnets.
AzureFirewallSubnet - the firewall is in this subnet.
Workload-SN - the workload server is in this subnet. This subnet's network traffic goes through the firewall.
Jump-SN - The "jump" server is in this subnet. The jump server has a public IP address that you can connect to
using Remote Desktop. From there, you can then connect to (using another Remote Desktop) the workload
server.
O P T IO N EXA M P L E/ L IN K
Select the Cloud Shell button on the menu bar at the upper
right in the Azure portal.
Prerequisites
Azure CLI
If you choose to install and use the CLI locally, run Azure CLI version 2.0.4 or later. To find the version, run az --
version . For information about installing or upgrading, see Install Azure CLI.
Install the Azure Firewall extension:
Create a VNet
This virtual network has three subnets.
NOTE
The size of the AzureFirewallSubnet subnet is /26. For more information about the subnet size, see Azure Firewall FAQ.
az vm create \
--resource-group Test-FW-RG \
--name Srv-Jump \
--location eastus \
--image win2016datacenter \
--vnet-name Test-FW-VN \
--subnet Jump-SN \
--admin-username azureadmin
az vm open-port --port 3389 --resource-group Test-FW-RG --name Srv-Jump
Create a NIC for Srv-Work with specific DNS server IP addresses and no public IP address to test with.
Now create the workload virtual machine. When prompted, type a password for the virtual machine.
az vm create \
--resource-group Test-FW-RG \
--name Srv-Work \
--location eastus \
--image win2016datacenter \
--nics Srv-Work-NIC \
--admin-username azureadmin
Deploy the firewall
Now deploy the firewall into the virtual network.
Note the private IP address. You'll use it later when you create the default route.
Azure Firewall includes a built-in rule collection for infrastructure FQDNs that are allowed by default. These FQDNs
are specific for the platform and can't be used for other purposes. For more information, see Infrastructure FQDNs.
az vm list-ip-addresses \
-g Test-FW-RG \
-n Srv-Work
2. Connect a remote desktop to Sr v-Jump virtual machine, and sign in. From there, open a remote desktop
connection to the Sr v-Work private IP address and sign in.
3. On SRV-Work , open a PowerShell window and run the following commands:
nslookup www.google.com
nslookup www.microsoft.com
Both commands should return answers, showing that your DNS queries are getting through the firewall.
4. Run the following commands:
Invoke-WebRequest -Uri https://www.google.com
Invoke-WebRequest -Uri https://www.google.com
The www.google.com requests should succeed, and the www.microsoft.com requests should fail. This
demonstrates that your firewall rules are operating as expected.
So now you've verified that the firewall rules are working:
You can resolve DNS names using the configured external DNS server.
You can browse to the one allowed FQDN, but not to any others.
Clean up resources
You can keep your firewall resources for the next tutorial, or if no longer needed, delete the Test-FW-RG resource
group to delete all firewall-related resources:
az group delete \
-n Test-FW-RG
Next steps
Tutorial: Monitor Azure Firewall logs
Deploy an Azure Firewall with multiple public IP
addresses using Azure PowerShell
10/25/2020 • 2 minutes to read • Edit Online
NOTE
You can't remove the first ipConfiguration from the Azure Firewall public IP address configuration page. If you want to
modify the IP address, you can use Azure PowerShell.
$rgName = "resourceGroupName"
$vnet = Get-AzVirtualNetwork `
-Name "vnet" `
-ResourceGroupName $rgName
$pip1 = New-AzPublicIpAddress `
-Name "AzFwPublicIp1" `
-ResourceGroupName "rg" `
-Sku "Standard" `
-Location "centralus" `
-AllocationMethod Static
$pip2 = New-AzPublicIpAddress `
-Name "AzFwPublicIp2" `
-ResourceGroupName "rg" `
-Sku "Standard" `
-Location "centralus" `
-AllocationMethod Static
New-AzFirewall `
-Name "azFw" `
-ResourceGroupName $rgName `
-Location centralus `
-VirtualNetwork $vnet `
-PublicIpAddress @($pip1, $pip2)
Add a public IP address to an existing firewall
In this example, the public IP address azFwPublicIp1 is attached to the firewall.
$pip = New-AzPublicIpAddress `
-Name "azFwPublicIp1" `
-ResourceGroupName "rg" `
-Sku "Standard" `
-Location "centralus" `
-AllocationMethod Static
$azFw = Get-AzFirewall `
-Name "AzureFirewall" `
-ResourceGroupName "rg"
$azFw.AddPublicIpAddress($pip)
$azFw | Set-AzFirewall
$pip = Get-AzPublicIpAddress `
-Name "azFwPublicIp1" `
-ResourceGroupName "rg"
$azFw = Get-AzFirewall `
-Name "AzureFirewall" `
-ResourceGroupName "rg"
$azFw.RemovePublicIpAddress($pip)
$azFw | Set-AzFirewall
Next steps
Quickstart: Create an Azure Firewall with multiple public IP addresses - Resource Manager template
Deploy an Azure Firewall with Availability Zones
using Azure PowerShell
10/25/2020 • 2 minutes to read • Edit Online
Azure Firewall can be configured during deployment to span multiple Availability Zones for increased availability.
This feature enables the following scenarios:
You can increase availability to 99.99% uptime. For more information, see the Azure Firewall Service Level
Agreement (SLA). The 99.99% uptime SLA is offered when two or more Availability Zones are selected.
You can also associate Azure Firewall to a specific zone just for proximity reasons, using the service standard
99.95% SLA.
For more information about Azure Firewall Availability Zones, see What is Azure Firewall?
The following Azure PowerShell example shows how you can deploy an Azure Firewall with Availability Zones.
$rgName = "resourceGroupName"
$vnet = Get-AzVirtualNetwork `
-Name "vnet" `
-ResourceGroupName $rgName
$pip1 = New-AzPublicIpAddress `
-Name "AzFwPublicIp1" `
-ResourceGroupName "rg" `
-Sku "Standard" `
-Location "centralus" `
-AllocationMethod Static
New-AzFirewall `
-Name "azFw" `
-ResourceGroupName $rgName `
-Location centralus `
-VirtualNetwork $vnet `
-PublicIpAddress @($pip1) `
-Zone 1,2,3
Next steps
Tutorial: Monitor Azure Firewall logs
Integrate Azure Firewall with Azure Standard Load
Balancer
10/25/2020 • 3 minutes to read • Edit Online
You can integrate an Azure Firewall into a virtual network with an Azure Standard Load Balancer (either public or
internal).
The preferred design is to integrate an internal load balancer with your Azure firewall, as this is a much simpler
design. You can use a public load balancer if you already have one deployed and you want to keep it in place.
However, you need to be aware of an asymmetric routing issue that can break functionality with the public load
balancer scenario.
For more information about Azure Load Balancer, see What is Azure Load Balancer?
Health probes
Remember, you need to have a web service running on the hosts in the load balancer pool if you use TCP health
probes to port 80, or HTTP/HTTPS probes.
NOTE
The virtual machines in the backend pool will not have outbound internet connectivity with this configuration.
For more information on providing outbound connectivity see:
Outbound connections in Azure
Options for providing connectivity:
Outbound-only load balancer configuration
What is Vir tual Network NAT?
Additional security
To further enhance the security of your load-balanced scenario, you can use network security groups (NSGs).
For example, you can create an NSG on the backend subnet where the load-balanced virtual machines are located.
Allow incoming traffic originating from the firewall IP address/port.
Next steps
Learn how to deploy and configure an Azure Firewall.
Configure Azure Firewall application rules with SQL
FQDNs
10/25/2020 • 2 minutes to read • Edit Online
You can now configure Azure Firewall application rules with SQL FQDNs. This allows you to limit access from your
virtual networks to only the specified SQL server instances.
With SQL FQDNs, you can filter traffic:
From your VNets to an Azure SQL Database or Azure Synapse Analytics. For example: Only allow access to sql-
server1.database.windows.net.
From on-premises to Azure SQL Managed Instances or SQL IaaS running in your VNets.
From spoke-to-spoke to Azure SQL Managed Instances or SQL IaaS running in your VNets.
SQL FQDN filtering is supported in proxy-mode only (port 1433). If you use SQL in the default redirect mode, you
can filter access using the SQL service tag as part of network rules. If you use non-default ports for SQL IaaS traffic,
you can configure those ports in the firewall application rules.
NOTE
SQL proxy mode can result in more latency compared to redirect. If you want to continue using redirect mode, which
is the default for clients connecting within Azure, you can filter access using the SQL service tag in firewall network
rules.
3. Configure an application rule with SQL FQDN to allow access to a SQL server:
NOTE
SQL proxy mode can result in more latency compared to redirect. If you want to continue using redirect mode, which
is the default for clients connecting within Azure, you can filter access using the SQL service tag in firewall network
rules.
3. Add the application rule with the appropriate protocol, port, and SQL FQDN and then select Save .
4. Access SQL from a virtual machine in a VNet that filters the traffic through the firewall.
5. Validate that Azure Firewall logs show the traffic is allowed.
Next steps
To learn about SQL proxy and redirect modes, see Azure SQL Database connectivity architecture.
Azure Firewall SNAT private IP address ranges
10/25/2020 • 2 minutes to read • Edit Online
Azure Firewall provides automatic SNAT for all outbound traffic to public IP addresses. By default, Azure Firewall
doesn't SNAT with Network rules when the destination IP address is in a private IP address range per IANA RFC
1918. Application rules are always applied using a transparent proxy regardless of the destination IP address.
This logic works well when you route traffic directly to the Internet. However, if you've enabled forced tunneling,
Internet-bound traffic is SNATed to one of the firewall private IP addresses in AzureFirewallSubnet, hiding the
source from your on-premises firewall.
If your organization uses a public IP address range for private networks, Azure Firewall SNATs the traffic to one of
the firewall private IP addresses in AzureFirewallSubnet. However, you can configure Azure Firewall to not SNAT
your public IP address range. For example, to specify an individual IP address you can specify it like this:
192.168.1.10 . To specify a range of IP addresses, you can specify it like this: 192.168.1.0/24 .
To configure Azure Firewall to never SNAT regardless of the destination IP address, use 0.0.0.0/0 as your private
IP address range. With this configuration, Azure Firewall can never route traffic directly to the Internet. To configure
the firewall to always SNAT regardless of the destination address, use 255.255.255.255/32 as your private IP
address range.
IMPORTANT
If you want to specify your own private IP address ranges, and keep the default IANA RFC 1918 address ranges, make sure
your custom list still includes the IANA RFC 1918 range.
NOTE
IANAPrivateRanges is expanded to the current defaults on Azure Firewall while the other ranges are added to it. To keep the
IANAPrivateRanges default in your private range specification, it must remain in your PrivateRange specification as shown
in the following examples.
"additionalProperties": {
"Network.SNAT.PrivateRanges": "IANAPrivateRanges , IPRange1, IPRange2"
},
IP Groups allow you to group and manage IP addresses for Azure Firewall rules. They can have a single IP address,
multiple IP addresses, or one or more IP address ranges.
Create an IP Group
1. From the Azure portal home page, select Create a resource .
2. Type IP Groups in the search text box, then select IP Groups .
3. Select Create .
4. Select your subscription.
5. Select a resource group or create a new one.
6. Type a unique name for you IP Group, and then select a region.
7. Select Next: IP addresses .
8. Type an IP address, multiple IP addresses, or IP address ranges.
There are two ways to enter IP addresses:
You can manually enter them
You can import them from a file
To import from a file, select Impor t from a file . You may either drag your file to the box or select Browse
for files . If necessary, you can review and edit your uploaded IP addresses.
When you type an IP address, the portal validates it to check for overlapping, duplicates, and formatting
issues.
9. When finished, select Review + Create .
10. Select Create .
Next steps
Learn more about IP Groups
Use Azure Firewall to protect Window Virtual
Desktop deployments
10/25/2020 • 3 minutes to read • Edit Online
Windows Virtual Desktop is a desktop and app virtualization service that runs on Azure. When an end user
connects to a Windows Virtual Desktop environment, their session is run by a host pool. A host pool is a collection
of Azure virtual machines that register to Windows Virtual Desktop as session hosts. These virtual machines run in
your virtual network and are subject to the virtual network security controls. They need outbound Internet access
to the Windows Virtual Desktop service to operate properly and might also need outbound Internet access for end
users. Azure Firewall can help you lock down your environment and filter outbound traffic.
Follow the guidelines in this article to provide additional protection for your Windows Virtual Desktop host pool
using Azure Firewall.
Prerequisites
A deployed Windows Virtual Desktop environment and host pool.
For more information, see Tutorial: Create a host pool by using the Azure Marketplace and Create a host
pool with an Azure Resource Manager template.
To learn more about Windows Virtual Desktop environments see Windows Virtual Desktop environment.
AzureDiagnostics
| where Category == "AzureFirewallApplicationRule"
| search "Deny"
| search "gsm*eh.servicebus.windows.net" or "gsm*xt.blob.core.windows.net" or
"gsm*xt.table.core.windows.net"
| parse msg_s with Protocol " request from " SourceIP ":" SourcePort:int " to " FQDN ":" *
| project TimeGenerated,Protocol,FQDN
NOTE
Some deployments may not need DNS rules, for example Azure Active Directory Domain controllers forward DNS queries to
Azure DNS at 168.63.129.16.
Additional considerations
You may need to configure additional firewall rules, depending on your requirements:
NTP server access
By default, virtual machines running Windows connect to time.windows.com over UDP port 123 for time
synchronization. Create a network rule to allow this access, or for a time server that you use in your
environment.
Next steps
Learn more about Windows Virtual Desktop: What is Windows Virtual Desktop?
Use Azure Firewall to protect Azure Kubernetes
Service (AKS) Deployments
10/25/2020 • 3 minutes to read • Edit Online
Azure Kubernetes Service (AKS) offers a managed Kubernetes cluster on Azure. It reduces the complexity and
operational overhead of managing Kubernetes by offloading much of that responsibility to Azure. AKS handles
critical tasks, such as health monitoring and maintenance for you and delivers an enterprise-grade and secure
cluster with facilitated governance.
Kubernetes orchestrates clusters of virtual machines and schedules containers to run on those virtual machines
based on their available compute resources and the resource requirements of each container. Containers are
grouped into pods, the basic operational unit for Kubernetes, and those pods scale to the state that you want.
For management and operational purposes, nodes in an AKS cluster need to access certain ports and fully qualified
domain names (FQDNs). These actions could be to communicate with the API server, or to download and then
install core Kubernetes cluster components and node security updates. Azure Firewall can help you lock down your
environment and filter outbound traffic.
Follow the guidelines in this article to provide additional protection for your Azure Kubernetes cluster using Azure
Firewall.
Prerequisites
A deployed Azure Kubernetes cluster with running application.
For more information, see Tutorial: Deploy an Azure Kubernetes Service (AKS) cluster and Tutorial: Run
applications in Azure Kubernetes Service (AKS).
Securing AKS
Azure Firewall provides an AKS FQDN Tag to simplify the configuration. Use the following steps to allow outbound
AKS platform traffic:
When you use Azure Firewall to restrict outbound traffic and create a user-defined route (UDR) to direct all
outbound traffic, make sure you create an appropriate DNAT rule in Firewall to correctly allow inbound
traffic.
Using Azure Firewall with a UDR breaks the inbound setup because of asymmetric routing. The issue occurs
if the AKS subnet has a default route that goes to the firewall's private IP address, but you're using a public
load balancer. For example, inbound or Kubernetes service of type LoadBalancer.
In this case, the incoming load balancer traffic is received via its public IP address, but the return path goes
through the firewall's private IP address. Because the firewall is stateful, it drops the returning packet
because the firewall isn't aware of an established session. To learn how to integrate Azure Firewall with your
ingress or service load balancer, see Integrate Azure Firewall with Azure Standard Load Balancer.
Create an application rule collection and add a rule to enable the AzureKubernetesService FQDN tag. The
source IP address range is the host pool virtual network, the protocol is https, and the destination is
AzureKubernetesService.
The following outbound ports / network rules are required for an AKS cluster:
TCP port 443
TCP [IPAddrOfYourAPIServer]:443 is required if you have an app that needs to talk to the API server.
This change can be set after the cluster is created.
TCP port 9000, and UDP port 1194 for the tunnel front pod to communicate with the tunnel end on
the API server.
To be more specific, see the *.hcp..azmk8s.io and addresses in the following table:
UDP port 123 for Network Time Protocol (NTP) time synchronization (Linux nodes).
UDP port 53 for DNS is also required if you have pods directly accessing the API server.
For more information, see Control egress traffic for cluster nodes in Azure Kubernetes Service (AKS).
Configure AzureMonitor and Storage service tags. Azure Monitor receives log analytics data.
You can also allow your workspace URL individually: <worksapceguid>.ods.opinsights.azure.com , and
<worksapceguid>.oms.opinsights.azure.com . You can address this in one of the following ways:
Allow https access from your host pool subnet to *. ods.opinsights.azure.com , and
*.oms. opinsights.azure.com . These wildcard FQDNs enable the required access but are less restrictive.
Use the following log analytics query to list the exact required FQDNs, and then allow them explicitly in
your firewall application rules:
AzureDiagnostics
| where Category == "AzureFirewallApplicationRule"
| search "Allow"
| search "*. ods.opinsights.azure.com" or "*.oms. opinsights.azure.com"
| parse msg_s with Protocol " request from " SourceIP ":" SourcePort:int " to " FQDN ":" *
| project TimeGenerated,Protocol,FQDN
Next steps
Learn more about Azure Kubernetes Service, see Kubernetes core concepts for Azure Kubernetes Service (AKS).
Azure Firewall DNS settings (preview)
10/25/2020 • 2 minutes to read • Edit Online
IMPORTANT
Azure Firewall DNS settings is currently in public preview. This preview version is provided without a service level agreement,
and it's not recommended for production workloads. Certain features might not be supported or might have constrained
capabilities. For more information, see Supplemental Terms of Use for Microsoft Azure Previews.
You can configure a custom DNS server and enable DNS proxy for Azure Firewall. You can configure these settings
when you deploy the firewall or later from the DNS settings page.
DNS servers
A DNS server maintains and resolves domain names to IP addresses. By default, Azure Firewall uses Azure DNS for
name resolution. The DNS ser ver setting lets you configure your own DNS servers for Azure Firewall name
resolution. You can configure a single or multiple servers.
Configure custom DNS servers (preview)
1. Under Azure Firewall Settings , select DNS Settings .
2. Under DNS ser vers , you can type or add existing DNS servers that have been previously specified in your
Virtual Network.
3. Select Save .
4. The firewall now directs DNS traffic to the specified DNS server(s) for name resolution.
Next steps
FQDN filtering in network rules
Monitor Azure Firewall logs and metrics
10/25/2020 • 4 minutes to read • Edit Online
You can monitor Azure Firewall using firewall logs. You can also use activity logs to audit operations on Azure
Firewall resources. Using metrics, you can view performance counters in the portal.
You can access some of these logs through the portal. Logs can be sent to Azure Monitor logs, Storage, and Event
Hubs and analyzed in Azure Monitor logs or by different tools such as Excel and Power BI.
NOTE
This article was recently updated to use the term Azure Monitor logs instead of Log Analytics. Log data is still stored in a Log
Analytics workspace and is still collected and analyzed by the same Log Analytics service. We are updating the terminology to
better reflect the role of logs in Azure Monitor. See Azure Monitor terminology changes for details.
NOTE
This article has been updated to use the new Azure PowerShell Az module. You can still use the AzureRM module, which will
continue to receive bug fixes until at least December 2020. To learn more about the new Az module and AzureRM
compatibility, see Introducing the new Azure PowerShell Az module. For Az module installation instructions, see Install Azure
PowerShell.
Prerequisites
Before starting you should read Azure Firewall logs and metrics for an overview of the diagnostics logs and metrics
available for Azure Firewall.
TIP
Diagnostic logs do not require a separate storage account. The use of storage for access and performance logging incurs
service charges.
TIP
If you are familiar with Visual Studio and basic concepts of changing values for constants and variables in C#, you can use the
log converter tools available from GitHub.
View metrics
Browse to an Azure Firewall, under Monitoring select Metrics . To view the available values, select the METRIC
drop-down list.
Next steps
Now that you've configured your firewall to collect logs, you can explore Azure Monitor logs to view your data.
Networking monitoring solutions in Azure Monitor logs
Azure Monitor logs for Azure Firewall
10/25/2020 • 6 minutes to read • Edit Online
The following Azure Monitor logs samples can be used to analyze your Azure Firewall logs. The sample file is built
in View Designer in Azure Monitor, the View Designer in Azure Monitor article has more information about the
View Design concept.
NOTE
This article was recently updated to use the term Azure Monitor logs instead of Log Analytics. Log data is still stored in a
Log Analytics workspace and is still collected and analyzed by the same Log Analytics service. We are updating the
terminology to better reflect the role of logs in Azure Monitor. See Azure Monitor terminology changes for details.
AzureDiagnostics
| where Category == "AzureFirewallApplicationRule"
//using :int makes it easier to pars but later we'll convert to string as we're not interested to do
mathematical functions on these fields
//this first parse statement is valid for all entries as they all start with this format
| parse msg_s with Protocol " request from " SourceIP ":" SourcePortInt:int " " TempDetails
//case 1: for records that end with: "was denied. Reason: SNI TLS extension was missing."
| parse TempDetails with "was " Action1 ". Reason: " Rule1
//case 2: for records that end with
//"to ocsp.digicert.com:80. Action: Allow. Rule Collection: RC1. Rule: Rule1"
//"to v10.vortex-win.data.microsoft.com:443. Action: Deny. No rule matched. Proceeding with default action"
| parse TempDetails with "to " FQDN ":" TargetPortInt:int ". Action: " Action2 "." *
//case 2a: for records that end with:
//"to ocsp.digicert.com:80. Action: Allow. Rule Collection: RC1. Rule: Rule1"
| parse TempDetails with * ". Rule Collection: " RuleCollection2a ". Rule:" Rule2a
//case 2b: for records that end with:
//for records that end with: "to v10.vortex-win.data.microsoft.com:443. Action: Deny. No rule matched.
Proceeding with default action"
| parse TempDetails with * "Deny." RuleCollection2b ". Proceeding with" Rule2b
| extend
SourcePort = tostring(SourcePortInt)
|extend
TargetPort = tostring(TargetPortInt)
| extend
//make sure we only have Allowed / Deny in the Action Field
Action1 = case(Action1 == "Deny","Deny","Unknown Action")
| extend
Action = case(Action2 == "",Action1,Action2),
Rule = case(Rule2a == "",case(Rule1 == "",case(Rule2b == "","N/A", Rule2b),Rule1),Rule2a),
RuleCollection = case(RuleCollection2b == "",case(RuleCollection2a == "","No rule
matched",RuleCollection2a),RuleCollection2b),
FQDN = case(FQDN == "", "N/A", FQDN),
TargetPort = case(TargetPort == "", "N/A", TargetPort)
| project TimeGenerated, msg_s, Protocol, SourceIP, SourcePort, FQDN, TargetPort, Action ,RuleCollection, Rule
AzureDiagnostics
| where Category == "AzureFirewallNetworkRule"
//using :int makes it easier to pars but later we'll convert to string as we're not interested to do
mathematical functions on these fields
//case 1: for records that look like this:
//TCP request from 10.0.2.4:51990 to 13.69.65.17:443. Action: Deny//Allow
//UDP request from 10.0.3.4:123 to 51.141.32.51:123. Action: Deny/Allow
//TCP request from 193.238.46.72:50522 to 40.119.154.83:3389 was DNAT'ed to 10.0.2.4:3389
| parse msg_s with Protocol " request from " SourceIP ":" SourcePortInt:int " to
" TargetIP ":" TargetPortInt:int *
//case 1a: for regular network rules
//TCP request from 10.0.2.4:51990 to 13.69.65.17:443. Action: Deny//Allow
//UDP request from 10.0.3.4:123 to 51.141.32.51:123. Action: Deny/Allow
| parse msg_s with * ". Action: " Action1a
//case 1b: for NAT rules
//TCP request from 193.238.46.72:50522 to 40.119.154.83:3389 was DNAT'ed to 10.0.2.4:3389
| parse msg_s with * " was " Action1b " to " NatDestination
//case 2: for ICMP records
//ICMP request from 10.0.2.4 to 10.0.3.4. Action: Allow
| parse msg_s with Protocol2 " request from " SourceIP2 " to " TargetIP2 ". Action: " Action2
| extend
SourcePort = tostring(SourcePortInt),
TargetPort = tostring(TargetPortInt)
| extend
Action = case(Action1a == "", case(Action1b == "",Action2,Action1b), Action1a),
Protocol = case(Protocol == "", Protocol2, Protocol),
SourceIP = case(SourceIP == "", SourceIP2, SourceIP),
TargetIP = case(TargetIP == "", TargetIP2, TargetIP),
//ICMP records don't have port information
SourcePort = case(SourcePort == "", "N/A", SourcePort),
TargetPort = case(TargetPort == "", "N/A", TargetPort),
//Regular network rules don't have a DNAT destination
NatDestination = case(NatDestination == "", "N/A", NatDestination)
| project TimeGenerated, msg_s, Protocol, SourceIP,SourcePort,TargetIP,TargetPort,Action, NatDestination
AzureDiagnostics
| where OperationName == "AzureFirewallThreatIntelLog"
| parse msg_s with Protocol " request from " SourceIP ":" SourcePortInt:int " to " TargetIP ":"
TargetPortInt:int *
| parse msg_s with * ". Action: " Action "." Message
| parse msg_s with Protocol2 " request from " SourceIP2 " to " TargetIP2 ". Action: " Action2
| extend SourcePort = tostring(SourcePortInt),TargetPort = tostring(TargetPortInt)
| extend Protocol = case(Protocol == "", Protocol2, Protocol),SourceIP = case(SourceIP == "", SourceIP2,
SourceIP),TargetIP = case(TargetIP == "", TargetIP2, TargetIP),SourcePort = case(SourcePort == "", "N/A",
SourcePort),TargetPort = case(TargetPort == "", "N/A", TargetPort)
| sort by TimeGenerated desc | project TimeGenerated, msg_s, Protocol,
SourceIP,SourcePort,TargetIP,TargetPort,Action,Message
Sample logs
The following log samples show the data included in a log entry.
Next steps
To learn about Azure Firewall monitoring and diagnostics, see Tutorial: Monitor Azure Firewall logs and metrics.
Monitor logs using Azure Firewall Workbook
10/25/2020 • 2 minutes to read • Edit Online
Azure Firewall Workbook provides a flexible canvas for Azure Firewall data analysis. You can use it to create rich
visual reports within the Azure portal. You can tap into multiple Firewalls deployed across Azure, and combine
them into unified interactive experiences.
You can gain insights into Azure Firewall events, learn about your application and network rules, and see statistics
for firewall activities across URLs, ports, and addresses. Azure Firewall Workbook allows you to filter your firewalls
and resource groups, and dynamically filter per category with easy to read data sets when investigating an issue in
your logs.
Prerequisites
Before starting, you should enable diagnostic logging through the Azure portal. Also, read Azure Firewall logs and
metrics for an overview of the diagnostics logs and metrics available for Azure Firewall.
Get started
To deploy the workbook, go to Azure Monitor Workbook for Azure Firewall and following the instructions on the
page. Azure Firewall Workbook is designed to work across multi-tenants, multi-subscriptions, and is filterable to
multiple firewalls.
Overview page
The overview page provides you with a way to filter across workspaces, time, and firewalls. It shows events by time
across firewalls and log types (application, networks, threat intel, DNS proxy).
Next steps
Learn more about Azure Firewall Diagnostics
What is Azure Resource Manager?
10/25/2020 • 6 minutes to read • Edit Online
Azure Resource Manager is the deployment and management service for Azure. It provides a management layer
that enables you to create, update, and delete resources in your Azure account. You use management features, like
access control, locks, and tags, to secure and organize your resources after deployment.
To learn about Azure Resource Manager templates, see Template deployment overview.
All capabilities that are available in the portal are also available through PowerShell, Azure CLI, REST APIs, and client
SDKs. Functionality initially released through APIs will be represented in the portal within 180 days of initial release.
Terminology
If you're new to Azure Resource Manager, there are some terms you might not be familiar with.
resource - A manageable item that is available through Azure. Virtual machines, storage accounts, web apps,
databases, and virtual networks are examples of resources. Resource groups, subscriptions, management
groups, and tags are also examples of resources.
resource group - A container that holds related resources for an Azure solution. The resource group includes
those resources that you want to manage as a group. You decide which resources belong in a resource group
based on what makes the most sense for your organization. See Resource groups.
resource provider - A service that supplies Azure resources. For example, a common resource provider is
Microsoft.Compute, which supplies the virtual machine resource. Microsoft.Storage is another common
resource provider. See Resource providers and types.
Resource Manager template - A JavaScript Object Notation (JSON) file that defines one or more resources to
deploy to a resource group, subscription, management group, or tenant. The template can be used to deploy the
resources consistently and repeatedly. See Template deployment overview.
declarative syntax - Syntax that lets you state "Here is what I intend to create" without having to write the
sequence of programming commands to create it. The Resource Manager template is an example of declarative
syntax. In the file, you define the properties for the infrastructure to deploy to Azure. See Template deployment
overview.
Understand scope
Azure provides four levels of scope: management groups, subscriptions, resource groups, and resources. The
following image shows an example of these layers.
You apply management settings at any of these levels of scope. The level you select determines how widely the
setting is applied. Lower levels inherit settings from higher levels. For example, when you apply a policy to the
subscription, the policy is applied to all resource groups and resources in your subscription. When you apply a
policy on the resource group, that policy is applied the resource group and all its resources. However, another
resource group doesn't have that policy assignment.
You can deploy templates to tenants, management groups, subscriptions, or resource groups.
Resource groups
There are some important factors to consider when defining your resource group:
All the resources in your resource group should share the same lifecycle. You deploy, update, and delete
them together. If one resource, such as a server, needs to exist on a different deployment cycle it should be in
another resource group.
Each resource can exist in only one resource group.
You can add or remove a resource to a resource group at any time.
You can move a resource from one resource group to another group. For more information, see Move
resources to new resource group or subscription.
The resources in a resource group can be located in different regions than the resource group.
When creating a resource group, you need to provide a location for that resource group. You may be
wondering, "Why does a resource group need a location? And, if the resources can have different locations
than the resource group, why does the resource group location matter at all?" The resource group stores
metadata about the resources. When you specify a location for the resource group, you're specifying where
that metadata is stored. For compliance reasons, you may need to ensure that your data is stored in a
particular region.
If the resource group's region is temporarily unavailable, you can't update resources in the resource group
because the metadata is unavailable. The resources in other regions will still function as expected, but you
can't update them. For more information about building reliable applications, see Designing reliable Azure
applications.
A resource group can be used to scope access control for administrative actions. To manage a resource
group, you can assign Azure Policies, Azure roles, or resource locks.
You can apply tags to a resource group. The resources in the resource group don't inherit those tags.
A resource can connect to resources in other resource groups. This scenario is common when the two
resources are related but don't share the same lifecycle. For example, you can have a web app that connects
to a database in a different resource group.
When you delete a resource group, all resources in the resource group are also deleted. For information
about how Azure Resource Manager orchestrates those deletions, see Azure Resource Manager resource
group and resource deletion.
You can deploy up to 800 instances of a resource type in each resource group. Some resource types are
exempt from the 800 instance limit.
Some resources can exist outside of a resource group. These resources are deployed to the subscription,
management group, or tenant. Only specific resource types are supported at these scopes.
To create a resource group, you can use the portal, PowerShell, Azure CLI, or an Azure Resource Manager
(ARM) template.
How does Azure Firewall work differently from existing services such as
NVAs in the marketplace?
Azure Firewall is a basic firewall service that can address certain customer scenarios. It's expected that you'll have a
mix of third-party NVAs and Azure Firewall. Working better together is a core priority.
# Start a firewall
NOTE
You must reallocate a firewall and public IP to the original resource group and subscription.
Can Azure Firewall in a hub virtual network forward and filter network
traffic between two spoke virtual networks?
Yes, you can use Azure Firewall in a hub virtual network to route and filter traffic between two spoke virtual
network. Subnets in each of the spoke virtual networks must have a UDR pointing to the Azure Firewall as a default
gateway for this scenario to work properly.
Can Azure Firewall forward and filter network traffic between subnets in
the same virtual network or peered virtual networks?
Yes. However, configuring the UDRs to redirect traffic between subnets in the same VNET requires additional
attention. While using the VNET address range as a target prefix for the UDR is sufficient, this also routes all traffic
from one machine to another machine in the same subnet through the Azure Firewall instance. To avoid this,
include a route for the subnet in the UDR with a next hop type of VNET . Managing these routes might be
cumbersome and prone to error. The recommended method for internal network segmentation is to use Network
Security Groups, which don't require UDRs.
Does the firewall subnet size need to change as the service scales?
No. Azure Firewall doesn't need a subnet bigger than /26.
Why can a TCP ping and similar tools successfully connect to a target
FQDN even when no rule on Azure Firewall allows that traffic?
A TCP ping isn't actually connecting to the target FQDN. This happens because Azure Firewall's transparent proxy
listens on port 80/443 for outbound traffic. The TCP ping establishes a connection with the firewall, which then
drops the packet and logs the connection. This behavior doesn't have any security impact. However, to avoid
confusion we're investigating potential changes to this behavior.
This article describes the structure of an Azure Resource Manager (ARM) template. It presents the different sections of a
template and the properties that are available in those sections.
This article is intended for users who have some familiarity with ARM templates. It provides detailed information about the
structure of the template. For a step-by-step tutorial that guides you through the process of creating a template, see
Tutorial: Create and deploy your first Azure Resource Manager template.
Template format
In its simplest structure, a template has the following elements:
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "",
"apiProfile": "",
"parameters": { },
"variables": { },
"functions": [ ],
"resources": [ ],
"outputs": { }
}
Each element has properties you can set. This article describes the sections of the template in greater detail.
Parameters
In the parameters section of the template, you specify which values you can input when deploying the resources. You're
limited to 256 parameters in a template. You can reduce the number of parameters by using objects that contain multiple
properties.
The available properties for a parameter are:
"parameters": {
"<parameter-name>" : {
"type" : "<type-of-parameter-value>",
"defaultValue": "<default-value-of-parameter>",
"allowedValues": [ "<array-of-allowed-values>" ],
"minValue": <minimum-value-for-int>,
"maxValue": <maximum-value-for-int>,
"minLength": <minimum-length-for-string-or-array>,
"maxLength": <maximum-length-for-string-or-array-parameters>,
"metadata": {
"description": "<description-of-the parameter>"
}
}
}
For examples of how to use parameters, see Parameters in Azure Resource Manager templates.
Data types
For integers passed as inline parameters, the range of values may be limited by the SDK or command-line tool you use for
deployment. For example, when using PowerShell to deploy a template, integer types can range from -2147483648 to
2147483647. To avoid this limitation, specify large integer values in a parameter file. Resource types apply their own limits
for integer properties.
When specifying boolean and integer values in your template, don't surround the value with quotation marks. Start and
end string values with double quotation marks.
Objects start with a left brace and end with a right brace. Arrays start with a left bracket and end with a right bracket.
When you set a parameter to a secure string or secure object, the value of the parameter isn't saved to the deployment
history and isn't logged. However, if you set that secure value to a property that isn't expecting a secure value, the value
isn't protected. For example, if you set a secure string to a tag, that value is stored as plain text. Use secure strings for
passwords and secrets.
For samples of formatting data types, see Parameter type formats.
Variables
In the variables section, you construct values that can be used throughout your template. You don't need to define
variables, but they often simplify your template by reducing complex expressions.
The following example shows the available options for defining a variable:
"variables": {
"<variable-name>": "<variable-value>",
"<variable-name>": {
<variable-complex-type-value>
},
"<variable-object-name>": {
"copy": [
{
"name": "<name-of-array-property>",
"count": <number-of-iterations>,
"input": <object-or-value-to-repeat>
}
]
},
"copy": [
{
"name": "<variable-array-name>",
"count": <number-of-iterations>,
"input": <object-or-value-to-repeat>
}
]
}
For information about using copy to create several values for a variable, see Variable iteration.
For examples of how to use variables, see Variables in Azure Resource Manager template.
Functions
Within your template, you can create your own functions. These functions are available for use in your template. Typically,
you define complicated expressions that you don't want to repeat throughout your template. You create the user-defined
functions from expressions and functions that are supported in templates.
When defining a user function, there are some restrictions:
The function can't access variables.
The function can only use parameters that are defined in the function. When you use the parameters function within a
user-defined function, you're restricted to the parameters for that function.
The function can't call other user-defined functions.
The function can't use the reference function.
Parameters for the function can't have default values.
"functions": [
{
"namespace": "<namespace-for-functions>",
"members": {
"<function-name>": {
"parameters": [
{
"name": "<parameter-name>",
"type": "<type-of-parameter-value>"
}
],
"output": {
"type": "<type-of-output-value>",
"value": "<function-return-value>"
}
}
}
}
],
For examples of how to use custom functions, see User-defined functions in Azure Resource Manager template.
Resources
In the resources section, you define the resources that are deployed or updated.
You define resources with the following structure:
"resources": [
{
"condition": "<true-to-deploy-this-resource>",
"type": "<resource-provider-namespace/resource-type-name>",
"apiVersion": "<api-version-of-resource>",
"name": "<name-of-the-resource>",
"comments": "<your-reference-notes>",
"location": "<location-of-resource>",
"dependsOn": [
"<array-of-related-resource-names>"
],
"tags": {
"<tag-name1>": "<tag-value1>",
"<tag-name2>": "<tag-value2>"
},
"sku": {
"name": "<sku-name>",
"tier": "<sku-tier>",
"size": "<sku-size>",
"family": "<sku-family>",
"capacity": <sku-capacity>
},
"kind": "<type-of-resource>",
"copy": {
"name": "<name-of-copy-loop>",
"count": <number-of-iterations>,
"mode": "<serial-or-parallel>",
"batchSize": <number-to-deploy-serially>
},
"plan": {
"name": "<plan-name>",
"promotionCode": "<plan-promotion-code>",
"publisher": "<plan-publisher>",
"product": "<plan-product>",
"version": "<plan-version>"
},
"properties": {
"<settings-for-the-resource>",
"copy": [
{
"name": ,
"count": ,
"input": {}
}
]
},
"resources": [
"<array-of-child-resources>"
]
}
]
Outputs
In the Outputs section, you specify values that are returned from deployment. Typically, you return values from resources
that were deployed.
The following example shows the structure of an output definition:
"outputs": {
"<output-name>": {
"condition": "<boolean-value-whether-to-output-value>",
"type": "<type-of-output-value>",
"value": "<output-value-expression>",
"copy": {
"count": <number-of-iterations>,
"input": <values-for-the-variable>
}
}
}
For examples of how to use outputs, see Outputs in Azure Resource Manager template.
NOTE
To deploy templates with comments by using Azure CLI with version 2.3.0 or older, you must use the
--handle-extended-json-format switch.
{
"type": "Microsoft.Compute/virtualMachines",
"apiVersion": "2018-10-01",
"name": "[variables('vmName')]", // to customize name, change it in variables
"location": "[parameters('location')]", //defaults to resource group location
"dependsOn": [ /* storage account and network interface must be deployed first */
"[resourceId('Microsoft.Storage/storageAccounts/', variables('storageAccountName'))]",
"[resourceId('Microsoft.Network/networkInterfaces/', variables('nicName'))]"
],
In Visual Studio Code, the Azure Resource Manager Tools extension can automatically detect Resource Manager template
and change the language mode accordingly. If you see Azure Resource Manager Template at the bottom-right corner
of VS Code, you can use the inline comments. The inline comments are no longer marked as invalid.
Metadata
You can add a metadata object almost anywhere in your template. Resource Manager ignores the object, but your JSON
editor may warn you that the property isn't valid. In the object, define the properties you need.
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"metadata": {
"comments": "This template was developed for demonstration purposes.",
"author": "Example Name"
},
"parameters": {
"adminUsername": {
"type": "string",
"metadata": {
"description": "User name for the Virtual Machine."
}
},
When deploying the template through the portal, the text you provide in the description is automatically used as a tip for
that parameter.
For resources , add a comments element or a metadata object. The following example shows both a comments element
and a metadata object.
"resources": [
{
"type": "Microsoft.Storage/storageAccounts",
"apiVersion": "2018-07-01",
"name": "[concat('storage', uniqueString(resourceGroup().id))]",
"comments": "Storage account used to store VM disks",
"location": "[parameters('location')]",
"metadata": {
"comments": "These tags are needed for policy compliance."
},
"tags": {
"Dept": "[parameters('deptName')]",
"Environment": "[parameters('environment')]"
},
"sku": {
"name": "Standard_LRS"
},
"kind": "Storage",
"properties": {}
}
]
"outputs": {
"hostname": {
"type": "string",
"value": "[reference(variables('publicIPAddressName')).dnsSettings.fqdn]",
"metadata": {
"comments": "Return the fully qualified domain name"
}
},
Multi-line strings
You can break a string into multiple lines. For example, see the location property and one of the comments in the following
JSON example.
{
"type": "Microsoft.Compute/virtualMachines",
"apiVersion": "2018-10-01",
"name": "[variables('vmName')]", // to customize name, change it in variables
"location": "[
parameters('location')
]", //defaults to resource group location
/*
storage account and network interface
must be deployed first
*/
"dependsOn": [
"[resourceId('Microsoft.Storage/storageAccounts/', variables('storageAccountName'))]",
"[resourceId('Microsoft.Network/networkInterfaces/', variables('nicName'))]"
],
To deploy templates with multi-line strings by using Azure CLI with version 2.3.0 or older, you must use the
--handle-extended-json-format switch.
Next steps
To view complete templates for many different types of solutions, see the Azure Quickstart Templates.
For details about the functions you can use from within a template, see Azure Resource Manager Template Functions.
To combine several templates during deployment, see Using linked templates with Azure Resource Manager.
For recommendations about creating templates, see Azure Resource Manager template best practices.
For answers to common questions, see Frequently asked questions about ARM templates.