How to Backup and Restore Azure Firewall using Azure PowerShell?

In this article, we will guide you through a step-by-step process on how to backup and restore Azure Firewall from target resources using Azure PowerShell commands. Gain a comprehensive understanding of the operations involved and learn how to effectively manage your Azure Firewall backups and restorations.

Backup Azure Firewall:

Follow these steps to back up Azure Firewall resource using Azure PowerShell Commands.

Step 1: Switch to default target Subscription using the following Azure PowerShell command

$SubscriptionName = "<add_subscription_name_here>"
Set-AzContext -SubscriptionName "$SubscriptionName"

Step 2: Get the Azure Firewall Id

$FirewallName = "<add_firewall_name_here>"
$FirewallRgName = "<add_firewall_resource_group_name_here>"
$AzureFirewallId = (Get-AzFirewall -Name "$FirewallName" -ResourceGroupName "$FirewallRgName").id

Step 3: Export Azure Firewall to JSON file copy

$BackupFileName = ".\FirewallBackup-File-01.json"
Export-AzResourceGroup -ResourceGroupName "$FirewallRgName" -Resource $AzureFirewallId -SkipAllParameterization -Path $BackupFileName

Now we are done with backing the Azure Firewall resource.

Restore Azure Firewall

Follow these steps to restore Azure Firewall resource from Backup file using Azure PowerShell Commands.

Step 1: Switch to default target Subscription using the following Azure PowerShell command

$SubscriptionName = "<add_subscription_name_here>"
Set-AzContext -SubscriptionName "$SubscriptionName"

Step 2: Restore Azure Firewall from Backup

$FirewallName = "<add_firewall_name_here>"
$FirewallRgName = "<add_firewall_rg_name_here>"
$BackupFileName = ".\FirewallBackup-File-01.json"
New-AzResourceGroupDeployment -name "$FirewallName" -ResourceGroupName "$FirewallRgName" -TemplateFile "$BackupFileName"

Once you are done with the operation. you are ready to test or use your Azure Firewall resource.