Skip to content

Commit 59a32b7

Browse files
teilmeierVeryEarly
andauthored
Added sample code for Set-AzFirewall which updates existing rules (#12045)
* Update Set-AzFirewall.md Added an advanced example to update existing Azure Firewall rules using PowerShell based on customer feedback. * Update ChangeLog.md * Update ChangeLog.md no need to update changelog for help changes Co-authored-by: Yabo Hu <[email protected]>
1 parent cadf239 commit 59a32b7

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

src/Network/Network/ChangeLog.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020

2121
## Upcoming Release
2222
* Added support for AddressPrefixType parameter to `Remove-AzExpressRouteCircuitConnectionConfig
23-
2423
* Added name validation for `New-AzIpGroup`
2524

2625
## Version 3.0.0

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

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ $azFw | Set-AzFirewall
122122

123123
In this example, the management public IP address of the firewall will be changed to "AzFwMgmtPublicIp2"
124124

125-
### 6: Add DNS configuration to an Azure Firewall
125+
### 9: Add DNS configuration to an Azure Firewall
126126
```
127127
$dnsServers = @("10.10.10.1", "20.20.20.2")
128128
$azFw = Get-AzFirewall -Name "AzureFirewall" -ResourceGroupName "rg"
@@ -134,6 +134,17 @@ $azFw | Set-AzFirewall
134134

135135
In this example, DNS Proxy and DNS Server configuration is attached to the Firewall.
136136

137+
### 10: Update destination of an existing rule within a Firewall application rule collection
138+
```
139+
$azFw = Get-AzFirewall -Name "AzureFirewall" -ResourceGroupName "rg"
140+
$ruleCollection = $azFw.GetNetworkRuleCollectionByName("ruleCollectionName")
141+
$rule=$ruleCollection.GetRuleByName("ruleName")
142+
$rule.DestinationAddresses="10.10.10.10"
143+
Set-AzFirewall -AzureFirewall $azFw
144+
```
145+
146+
This example updates the destination of an existing rule within a rule collection of an Azure Firewall. This allows you to automatically update your rules when IP addresses change dynamically.
147+
137148
## PARAMETERS
138149

139150
### -AsJob

0 commit comments

Comments
 (0)