New-AzApplicationGatewayFirewallPolicy

Creates a application gateway firewall policy.

Syntax

New-AzApplicationGatewayFirewallPolicy
   -Name <String>
   -ResourceGroupName <String>
   -Location <String>
   [-CustomRule <PSApplicationGatewayFirewallCustomRule[]>]
   [-PolicySetting <PSApplicationGatewayFirewallPolicySettings>]
   [-ManagedRule <PSApplicationGatewayFirewallPolicyManagedRules>]
   [-Tag <Hashtable>]
   [-Force]
   [-AsJob]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

The New-AzApplicationGatewayFirewallPolicy cmdlet creates a application gateway firewall policy.

Examples

Example 1

$firewallPolicy = New-AzApplicationGatewayFirewallPolicy -Name wafResource1 -ResourceGroupName "rg1"  -Location  "westus" -CustomRule $customRule

This command creates a new Azure application gateway firewall policy named "wafResource1" in resource group "rg1" in location "westus" with custom rules defined in the $customRule variable

Example 2

Creates a application gateway firewall policy. (autogenerated)

New-AzApplicationGatewayFirewallPolicy -CustomRule <PSApplicationGatewayFirewallCustomRule[]> -Location 'westus' -Name wafResource1 -PolicySetting <PSApplicationGatewayFirewallPolicySettings> -ResourceGroupName 'rg1'

Parameters

-AsJob

Run cmdlet in the background

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-CustomRule

The list of CustomRules

Type:PSApplicationGatewayFirewallCustomRule[]
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with Azure.

Type:IAzureContextContainer
Aliases:AzContext, AzureRmContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Force

Do not ask for confirmation if you want to overwrite a resource

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Location

location.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-ManagedRule

Managed Rule Setting

Type:PSApplicationGatewayFirewallPolicyManagedRules
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-Name

The resource name.

Type:String
Aliases:ResourceName
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-PolicySetting

Policy Settings for Web Application Firewall

Type:PSApplicationGatewayFirewallPolicySettings
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-ResourceGroupName

The resource group name.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-Tag

A hashtable which represents resource tags.

Type:Hashtable
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

String

PSApplicationGatewayFirewallCustomRule[]

PSApplicationGatewayFirewallPolicySettings

PSApplicationGatewayFirewallPolicyManagedRules

Hashtable

Outputs

PSApplicationGatewayWebApplicationFirewallPolicy