Skip to content

Commit e294537

Browse files
authored
Update Set-AzFirewall.md (#22224)
Added exmple #15 which shows how to properly add or remove Availability zones to an Azure Firewall.
1 parent d01ed9e commit e294537

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

src/Network/Network/help/Set-AzFirewall.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,26 @@ Set-AzFirewall -AzureFirewall $azfw
231231

232232
This example upgrades your existing Azure Firewall Standard to Premium Firewall. Upgrade process may take several minutes and does not require service down time. After upgrade is completed successfully you may replace your exiting standard policy with premium.
233233

234+
### 15: Deallocate and allocate the Firewall with Availability Zones
235+
```powershell
236+
$firewall=Get-AzFirewall -ResourceGroupName rgName -Name azFw
237+
$firewall.Deallocate()
238+
$firewall | Set-AzFirewall
239+
240+
$vnet = Get-AzVirtualNetwork -ResourceGroupName rgName -Name anotherVNetName
241+
$pip = Get-AzPublicIpAddress -ResourceGroupName rgName -Name publicIpName
242+
$firewall.Zones = "1","2","3"
243+
$firewall.Allocate($vnet, $pip)
244+
$firewall | Set-AzFirewall
245+
```
246+
247+
This example retrieves a Firewall, deallocates the firewall, and saves it. The Deallocate command removes the running
248+
service but preserves the firewall's configuration. For changes to be reflected in cloud, Set-AzFirewall must be called.
249+
If user wants to start the service again but with Availability Zones, the Zones method needs to be called defining the desired Availability Zones in quotes and separated by comma. In case Availability Zones needs to be removed, the $null parameter needs to be introduced instead. Finally, the Allocate method should be called on the firewall.
250+
The new VNet and Public IP must be in the same resource group as the Firewall. Again, for changes to be reflected in cloud,
251+
Set-AzFirewall must be called.
252+
253+
234254
## PARAMETERS
235255

236256
### -AsJob

0 commit comments

Comments
 (0)