Skip to content

Commit 85081cf

Browse files
committed
Adding support for firewallPolicy on HttpListener and PathRule
1 parent 03843f2 commit 85081cf

File tree

2 files changed

+92
-1
lines changed

2 files changed

+92
-1
lines changed

src/Network/Network/help/New-AzApplicationGatewayHttpListener.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ New-AzApplicationGatewayHttpListener -Name <String> [-FrontendIPConfigurationId
1919
[-FrontendPortId <String>] [-SslCertificateId <String>] [-HostName <String>]
2020
[-RequireServerNameIndication <String>] -Protocol <String>
2121
[-CustomErrorConfiguration <PSApplicationGatewayCustomError[]>] [-DefaultProfile <IAzureContextContainer>]
22+
[-FirewallPolicyId <String>]
2223
[<CommonParameters>]
2324
```
2425

@@ -27,6 +28,7 @@ New-AzApplicationGatewayHttpListener -Name <String> [-FrontendIPConfigurationId
2728
New-AzApplicationGatewayHttpListener -Name <String>
2829
[-FrontendIPConfiguration <PSApplicationGatewayFrontendIPConfiguration>]
2930
[-FrontendPort <PSApplicationGatewayFrontendPort>] [-SslCertificate <PSApplicationGatewaySslCertificate>]
31+
[-FirewallPolicy <PSApplicationGatewayWebApplicationFirewallPolicy>]
3032
[-HostName <String>] [-RequireServerNameIndication <String>] -Protocol <String>
3133
[-CustomErrorConfiguration <PSApplicationGatewayCustomError[]>] [-DefaultProfile <IAzureContextContainer>]
3234
[<CommonParameters>]
@@ -52,6 +54,13 @@ PS C:\>$Listener = New-AzApplicationGatewayHttpListener -Name "Listener01" -Prot
5254
This command creates an HTTP listener that uses SSL offload and provides the SSL certificate in the $SSLCert01 variable.
5355
The command stores the result in the variable named $Listener.
5456

57+
### Example 3: Create an HTTP listener with firewall-policy
58+
```
59+
PS C:\>$Listener = New-AzApplicationGatewayHttpListener -Name "Listener01" -Protocol "Http" -FrontendIpConfiguration $FIp01 -FrontendPort $FP01 -FirewallPolicy $firewallPolicy
60+
```
61+
62+
This command creates an HTTP listener named Listener01, FirewallPolicy as $firewallPolicy and stores the result in the variable named $Listener.
63+
5564
## PARAMETERS
5665

5766
### -CustomErrorConfiguration
@@ -234,6 +243,43 @@ Accept pipeline input: False
234243
Accept wildcard characters: False
235244
```
236245
246+
### -FirewallPolicy
247+
Specifies the object reference to a top-level firewall policy.
248+
The object reference can be created by using New-AzApplicationGatewayWebApplicationFirewallPolicy cmdlet.
249+
$firewallPolicy = New-AzApplicationGatewayFirewallPolicy -Name "wafPolicy1" -ResourceGroup "rgName"
250+
A firewall policy created using the above commandlet can be referred at a path-rule level.
251+
he above command would create a default policy settings and managed rules.
252+
Instead of the default values, users can specify PolicySettings, ManagedRules by using New-AzApplicationGatewayFirewallPolicySettings and New-AzApplicationGatewayFirewallPolicyManagedRules respectively.
253+
254+
```yaml
255+
Type: Microsoft.Azure.Commands.Network.Models.PSApplicationGatewayWebApplicationFirewallPolicy
256+
Aliases:
257+
258+
Required: False
259+
Position: Named
260+
Default value: None
261+
Accept pipeline input: False
262+
Accept wildcard characters: False
263+
```
264+
265+
### -FirewallPolicyId
266+
Specifies the ID of an existing top-level web application firewall resource.
267+
Firewall policy IDs can be returned by using the Get-AzApplicationGatewayWebApplicationFirewallPolicy cmdlet.
268+
After we have the ID you can use *FirewallPolicyId* parameter instead of *FirewallPolicy* parameter.
269+
For instance:
270+
-FirewallPolicyId “/subscriptions/<subscription-id>/resourceGroups/<resource-group-id>/providers/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies/<firewallPolicyName>”
271+
272+
```yaml
273+
Type: Microsoft.Azure.Commands.Network.Models.PSApplicationGatewayWebApplicationFirewallPolicy
274+
Aliases:
275+
276+
Required: False
277+
Position: Named
278+
Default value: None
279+
Accept pipeline input: False
280+
Accept wildcard characters: False
281+
```
282+
237283
### CommonParameters
238284
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
239285

src/Network/Network/help/New-AzApplicationGatewayPathRuleConfig.md

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Creates an application gateway path rule.
1717
```
1818
New-AzApplicationGatewayPathRuleConfig -Name <String> -Paths <String[]> [-BackendAddressPoolId <String>]
1919
[-BackendHttpSettingsId <String>] [-RewriteRuleSetId <String>] [-RedirectConfigurationId <String>]
20-
[-DefaultProfile <IAzureContextContainer>] [<CommonParameters>]
20+
[-FirewallPolicyId <String>] [-DefaultProfile <IAzureContextContainer>] [<CommonParameters>]
2121
```
2222

2323
### SetByResource
@@ -26,6 +26,7 @@ New-AzApplicationGatewayPathRuleConfig -Name <String> -Paths <String[]>
2626
[-BackendAddressPool <PSApplicationGatewayBackendAddressPool>]
2727
[-BackendHttpSettings <PSApplicationGatewayBackendHttpSettings>]
2828
[-RewriteRuleSet <PSApplicationGatewayRewriteRuleSet>]
29+
[-FirewallPolicy <PSApplicationGatewayWebApplicationFirewallPolicy>]
2930
[-RedirectConfiguration <PSApplicationGatewayRedirectConfiguration>]
3031
[-DefaultProfile <IAzureContextContainer>] [<CommonParameters>]
3132
```
@@ -53,6 +54,13 @@ The next two commands create a backend address pool and a backend HTTP settings
5354
The fourth command creates the path rule object and is stored in a variable named $PathRuleConfig.
5455
The fifth command uses **Add-AzApplicationGatewayUrlPathMapConfig** to add the configuration settings and the new path rule contained within those settings to ContosoApplicationGateway.
5556

57+
### Example 2
58+
```
59+
PS C:\> $PathRuleConfig = New-AzApplicationGatewayPathRuleConfig -Name "base" -Paths "/base" -BackendAddressPool $AddressPool -BackendHttpSettings $HttpSettings -FirewallPolicy $firewallPolicy
60+
```
61+
62+
These command creates a path-rule with the Name as "base", Paths as "/base", BackendAddressPool as $AddressPool, BackendHttpSettings as $HttpSettings and FirewallPolicy as $firewallPolicy.ngs and the new path rule contained within those settings to ContosoApplicationGateway.
63+
5664
## PARAMETERS
5765

5866
### -BackendAddressPool
@@ -141,6 +149,43 @@ Accept pipeline input: False
141149
Accept wildcard characters: False
142150
```
143151
152+
### -FirewallPolicy
153+
Specifies the object reference to a top-level firewall policy.
154+
The object reference can be created by using New-AzApplicationGatewayWebApplicationFirewallPolicy cmdlet.
155+
$firewallPolicy = New-AzApplicationGatewayFirewallPolicy -Name "wafPolicy1" -ResourceGroup "rgName"
156+
A firewall policy created using the above commandlet can be referred at a path-rule level.
157+
he above command would create a default policy settings and managed rules.
158+
Instead of the default values, users can specify PolicySettings, ManagedRules by using New-AzApplicationGatewayFirewallPolicySettings and New-AzApplicationGatewayFirewallPolicyManagedRules respectively.
159+
160+
```yaml
161+
Type: Microsoft.Azure.Commands.Network.Models.PSApplicationGatewayWebApplicationFirewallPolicy
162+
Aliases:
163+
164+
Required: False
165+
Position: Named
166+
Default value: None
167+
Accept pipeline input: False
168+
Accept wildcard characters: False
169+
```
170+
171+
### -FirewallPolicyId
172+
Specifies the ID of an existing top-level web application firewall resource.
173+
Firewall policy IDs can be returned by using the Get-AzApplicationGatewayWebApplicationFirewallPolicy cmdlet.
174+
After we have the ID you can use *FirewallPolicyId* parameter instead of *FirewallPolicy* parameter.
175+
For instance:
176+
-FirewallPolicyId "/subscriptions/<subscription-id>/resourceGroups/<resource-group-id>/providers/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies/<firewallPolicyName>"
177+
178+
```yaml
179+
Type: Microsoft.Azure.Commands.Network.Models.PSApplicationGatewayWebApplicationFirewallPolicy
180+
Aliases:
181+
182+
Required: False
183+
Position: Named
184+
Default value: None
185+
Accept pipeline input: False
186+
Accept wildcard characters: False
187+
```
188+
144189
### -DefaultProfile
145190
The credentials, account, tenant, and subscription used for communication with azure.
146191

0 commit comments

Comments
 (0)