|
| 1 | +--- |
| 2 | +title: 'Quickstart: Create an Azure Firewall with Availability Zones - Bicep' |
| 3 | +description: In this quickstart, you deploy Azure Firewall using Bicep. The virtual network has one VNet with three subnets. Two Windows Server virtual machines, a jump box, and a server are deployed. |
| 4 | +services: firewall |
| 5 | +author: schaffererin |
| 6 | +ms.service: firewall |
| 7 | +ms.topic: quickstart |
| 8 | +ms.custom: subject-armqs, devx-track-azurepowershell, mode-arm |
| 9 | +ms.date: 06/28/2022 |
| 10 | +ms.author: v-eschaffer |
| 11 | +--- |
| 12 | + |
| 13 | +# Quickstart: Deploy Azure Firewall with Availability Zones - Bicep |
| 14 | + |
| 15 | +In this quickstart, you use Bicep to deploy an Azure Firewall in three Availability Zones. |
| 16 | + |
| 17 | +[!INCLUDE [About Bicep](../../includes/resource-manager-quickstart-bicep-introduction.md)] |
| 18 | + |
| 19 | +The Bicep file 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. |
| 20 | + |
| 21 | +The firewall is in the *AzureFirewallSubnet* subnet, and has an application rule collection with a single rule that allows access to `www.microsoft.com`. |
| 22 | + |
| 23 | +A user-defined route points network traffic from the *ServersSubnet* subnet through the firewall, where the firewall rules are applied. |
| 24 | + |
| 25 | +For more information about Azure Firewall, see [Deploy and configure Azure Firewall using the Azure portal](tutorial-firewall-deploy-portal.md). |
| 26 | + |
| 27 | +## Prerequisites |
| 28 | + |
| 29 | +- An Azure account with an active subscription. [Create an account for free](https://azure.microsoft.com/free/?WT.mc_id=A261C142F). |
| 30 | + |
| 31 | +## Review the Bicep file |
| 32 | + |
| 33 | +This Bicep file creates an Azure Firewall with Availability Zones, along with the necessary resources to support the Azure Firewall. |
| 34 | + |
| 35 | +The Bicep file used in this quickstart is from [Azure Quickstart Templates](https://azure.microsoft.com/resources/templates/azurefirewall-with-zones-sandbox). |
| 36 | + |
| 37 | +:::code language="bicep" source="~/quickstart-templates/quickstarts/microsoft.network/azurefirewall-with-zones-sandbox/main.bicep"::: |
| 38 | + |
| 39 | +Multiple Azure resources are defined in the Bicep file: |
| 40 | + |
| 41 | +- [**Microsoft.Storage/storageAccounts**](/azure/templates/microsoft.storage/storageAccounts) |
| 42 | +- [**Microsoft.Network/routeTables**](/azure/templates/microsoft.network/routeTables) |
| 43 | +- [**Microsoft.Network/networkSecurityGroups**](/azure/templates/microsoft.network/networksecuritygroups) |
| 44 | +- [**Microsoft.Network/virtualNetworks**](/azure/templates/microsoft.network/virtualnetworks) |
| 45 | +- [**Microsoft.Network/publicIPAddresses**](/azure/templates/microsoft.network/publicipaddresses) |
| 46 | +- [**Microsoft.Network/networkInterfaces**](/azure/templates/microsoft.network/networkinterfaces) |
| 47 | +- [**Microsoft.Compute/virtualMachines**](/azure/templates/microsoft.compute/virtualmachines) |
| 48 | +- [**Microsoft.Network/azureFirewalls**](/azure/templates/microsoft.network/azureFirewalls) |
| 49 | + |
| 50 | +## Deploy the Bicep file |
| 51 | + |
| 52 | +1. Save the Bicep file as `main.bicep` to your local computer. |
| 53 | +1. Deploy the Bicep file using either Azure CLI or Azure PowerShell. |
| 54 | + |
| 55 | + # [CLI](#tab/CLI) |
| 56 | + |
| 57 | + ```azurecli |
| 58 | + az group create --name exampleRG --location eastus |
| 59 | + az deployment group create --resource-group exampleRG --template-file main.bicep --parameters adminUsername=<admin-user> |
| 60 | + ``` |
| 61 | +
|
| 62 | + # [PowerShell](#tab/PowerShell) |
| 63 | +
|
| 64 | + ```azurepowershell |
| 65 | + New-AzResourceGroup -Name exampleRG -Location eastus |
| 66 | + New-AzResourceGroupDeployment -ResourceGroupName exampleRG -TemplateFile ./main.bicep -adminUsername "<admin-user>" |
| 67 | + ``` |
| 68 | +
|
| 69 | + --- |
| 70 | +
|
| 71 | + > [!NOTE] |
| 72 | + > Replace **\<admin-user\>** with the administrator login username for the virtual machine. You'll be prompted to enter **adminPassword**. |
| 73 | +
|
| 74 | + When the deployment finishes, you should see a message indicating the deployment succeeded. |
| 75 | +
|
| 76 | +## Review deployed resources |
| 77 | +
|
| 78 | +Use the Azure portal, Azure CLI, or Azure PowerShell to validate the deployment and review the deployed resources. |
| 79 | +
|
| 80 | +# [CLI](#tab/CLI) |
| 81 | +
|
| 82 | +```azurecli-interactive |
| 83 | +az resource list --resource-group exampleRG |
| 84 | +``` |
| 85 | + |
| 86 | +# [PowerShell](#tab/PowerShell) |
| 87 | + |
| 88 | +```azurepowershell-interactive |
| 89 | +Get-AzResource -ResourceGroupName exampleRG |
| 90 | +``` |
| 91 | + |
| 92 | +--- |
| 93 | + |
| 94 | +To learn about the syntax and properties for a firewall in a Bicep file, see [Microsoft.Network/azureFirewalls](/azure/templates/microsoft.network/azurefirewalls). |
| 95 | + |
| 96 | +## Clean up resources |
| 97 | + |
| 98 | +When you no longer need them, use the Azure portal, Azure CLI, or Azure PowerShell to remove the resource group, firewall, and all related resources. |
| 99 | + |
| 100 | +# [CLI](#tab/CLI) |
| 101 | + |
| 102 | +```azurecli-interactive |
| 103 | +az group delete --name exampleRG |
| 104 | +``` |
| 105 | + |
| 106 | +# [PowerShell](#tab/PowerShell) |
| 107 | + |
| 108 | +```azurepowershell-interactive |
| 109 | +Remove-AzResourceGroup -Name exampleRG |
| 110 | +``` |
| 111 | + |
| 112 | +--- |
| 113 | + |
| 114 | +## Next steps |
| 115 | + |
| 116 | +Next, you can monitor the Azure Firewall logs. |
| 117 | + |
| 118 | +> [!div class="nextstepaction"] |
| 119 | +> [Tutorial: Monitor Azure Firewall logs](./firewall-diagnostics.md) |
0 commit comments