|
| 1 | +--- |
| 2 | +title: 'Quickstart: Create an Azure Firewall and IP Groups - Bicep' |
| 3 | +description: In this quickstart, you learn how to use a Bicep file to create an Azure Firewall and IP Groups. |
| 4 | +services: firewall |
| 5 | +author: vhorne |
| 6 | +ms.service: firewall |
| 7 | +ms.topic: quickstart |
| 8 | +ms.custom: subject-bicepqs, devx-track-azurepowershell, mode-arm |
| 9 | +ms.date: 08/25/2022 |
| 10 | +ms.author: victorh |
| 11 | +--- |
| 12 | + |
| 13 | +# Quickstart: Create an Azure Firewall and IP Groups - Bicep |
| 14 | + |
| 15 | +In this quickstart, you use a Bicep file 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. IP Group is useful for managing IP addresses in Azure Firewall rules. You can either manually enter IP addresses or import them from a file. |
| 16 | + |
| 17 | +[!INCLUDE [About Bicep](../../includes/resource-manager-quickstart-bicep-introduction.md)] |
| 18 | + |
| 19 | +## Prerequisites |
| 20 | + |
| 21 | +- An Azure account with an active subscription. [Create an account for free](https://azure.microsoft.com/free/?WT.mc_id=A261C142F). |
| 22 | + |
| 23 | +## Review the Bicep file |
| 24 | + |
| 25 | +This Bicep file creates an Azure Firewall and IP Groups, along with the necessary resources to support the Azure Firewall. |
| 26 | + |
| 27 | +The Bicep file used in this quickstart is from [Azure Quickstart Templates](https://azure.microsoft.com/resources/templates/azurefirewall-create-with-ipgroups-and-linux-jumpbox). |
| 28 | + |
| 29 | +:::code language="bicep" source="~/quickstart-templates/quickstarts/microsoft.network/azurefirewall-create-with-ipgroups-and-linux-jumpbox/main.bicep"::: |
| 30 | + |
| 31 | +Multiple Azure resources are defined in the Bicep file: |
| 32 | + |
| 33 | +- [**Microsoft.Network/ipGroups**](/azure/templates/microsoft.network/ipGroups?pivots=deployment-language-bicep) |
| 34 | +- [**Microsoft.Storage/storageAccounts**](/azure/templates/microsoft.storage/storageAccounts?pivots=deployment-language-bicep) |
| 35 | +- [**Microsoft.Network/routeTables**](/azure/templates/microsoft.network/routeTables?pivots=deployment-language-bicep) |
| 36 | +- [**Microsoft.Network/networkSecurityGroups**](/azure/templates/microsoft.network/networksecuritygroups?pivots=deployment-language-bicep) |
| 37 | +- [**Microsoft.Network/virtualNetworks**](/azure/templates/microsoft.network/virtualnetworks?pivots=deployment-language-bicep) |
| 38 | +- [**Microsoft.Network/publicIPAddresses**](/azure/templates/microsoft.network/publicipaddresses?pivots=deployment-language-bicep) |
| 39 | +- [**Microsoft.Network/networkInterfaces**](/azure/templates/microsoft.network/networkinterfaces?pivots=deployment-language-bicep) |
| 40 | +- [**Microsoft.Compute/virtualMachines**](/azure/templates/microsoft.compute/virtualmachines?pivots=deployment-language-bicep) |
| 41 | +- [**Microsoft.Network/azureFirewalls**](/azure/templates/microsoft.network/azureFirewalls?pivots=deployment-language-bicep) |
| 42 | + |
| 43 | +## Deploy the Bicep file |
| 44 | + |
| 45 | +1. Save the Bicep file as **main.bicep** to your local computer. |
| 46 | +1. Deploy the Bicep file using either Azure CLI or Azure PowerShell. |
| 47 | + |
| 48 | + # [CLI](#tab/CLI) |
| 49 | + |
| 50 | + ```azurecli |
| 51 | + az group create --name exampleRG --location eastus |
| 52 | + az deployment group create --resource-group exampleRG --template-file main.bicep |
| 53 | + ``` |
| 54 | +
|
| 55 | + # [PowerShell](#tab/PowerShell) |
| 56 | +
|
| 57 | + ```azurepowershell |
| 58 | + New-AzResourceGroup -Name exampleRG -Location eastus |
| 59 | + New-AzResourceGroupDeployment -ResourceGroupName exampleRG -TemplateFile ./main.bicep |
| 60 | + ``` |
| 61 | +
|
| 62 | + --- |
| 63 | +
|
| 64 | +You'll be prompted to enter the following values: |
| 65 | +
|
| 66 | +- **Admin Username**: Type username for the administrator user account |
| 67 | +- **Admin Password**: Type an administrator password or key |
| 68 | +
|
| 69 | +When the deployment finishes, you should see a message indicating the deployment succeeded. |
| 70 | +
|
| 71 | +## Review deployed resources |
| 72 | +
|
| 73 | +Use the Azure portal, Azure CLI, or Azure PowerShell to validate the deployment and review the deployed resources. |
| 74 | +
|
| 75 | +# [CLI](#tab/CLI) |
| 76 | +
|
| 77 | +```azurecli-interactive |
| 78 | +az resource list --resource-group exampleRG |
| 79 | +``` |
| 80 | + |
| 81 | +# [PowerShell](#tab/PowerShell) |
| 82 | + |
| 83 | +```azurepowershell-interactive |
| 84 | +Get-AzResource -ResourceGroupName exampleRG |
| 85 | +``` |
| 86 | + |
| 87 | +--- |
| 88 | + |
| 89 | +To learn about the Bicep syntax and properties for a firewall in a Bicep file, see [Microsoft.Network azureFirewalls template reference](/azure/templates/microsoft.network/azurefirewalls?pivots=deployment-language-bicep). |
| 90 | + |
| 91 | +## Clean up resources |
| 92 | + |
| 93 | +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. |
| 94 | + |
| 95 | +# [CLI](#tab/CLI) |
| 96 | + |
| 97 | +```azurecli-interactive |
| 98 | +az group delete --name exampleRG |
| 99 | +``` |
| 100 | + |
| 101 | +# [PowerShell](#tab/PowerShell) |
| 102 | + |
| 103 | +```azurepowershell-interactive |
| 104 | +Remove-AzResourceGroup -Name exampleRG |
| 105 | +``` |
| 106 | + |
| 107 | +--- |
| 108 | + |
| 109 | +## Next steps |
| 110 | + |
| 111 | +> [!div class="nextstepaction"] |
| 112 | +> [Tutorial: Deploy and configure Azure Firewall in a hybrid network using the Azure portal](tutorial-hybrid-portal.md) |
0 commit comments