Edit

New-AzDdosCustomPolicy

Creates a DDoS custom policy.

Syntax

Default (Default)

New-AzDdosCustomPolicy
    -ResourceGroupName <String>
    -Name <String>
    -Location <String>
    [-Tag <Hashtable>]
    [-DetectionRule <PSDdosCustomPolicyDetectionRule[]>]
    [-AsJob]
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [-AcquirePolicyToken]
    [-ChangeReference <String>]
    [<CommonParameters>]

Description

The New-AzDdosCustomPolicy cmdlet creates a DDoS custom policy with detection rules. A DDoS custom policy allows you to define custom detection thresholds for different types of traffic (TCP, UDP, TCP SYN).

Examples

Example 1: Create a DDoS custom policy with a single detection rule

$rule = New-AzDdosCustomPolicyDetectionRule -Name "tcpRule1" -TrafficType Tcp -PacketsPerSecond 1000000
$policy = New-AzDdosCustomPolicy -ResourceGroupName "myRG" -Name "myPolicy" -Location "eastus" -DetectionRule @($rule)

This example creates a DDoS custom policy with a single TCP detection rule.

Example 2: Create a DDoS custom policy with multiple detection rules

$tcpRule = New-AzDdosCustomPolicyDetectionRule -Name "tcpRule1" -TrafficType Tcp -PacketsPerSecond 1000000
$udpRule = New-AzDdosCustomPolicyDetectionRule -Name "udpRule1" -TrafficType Udp -PacketsPerSecond 100000
$tcpSynRule = New-AzDdosCustomPolicyDetectionRule -Name "tcpSynRule1" -TrafficType TcpSyn -PacketsPerSecond 50000
$policy = New-AzDdosCustomPolicy -ResourceGroupName "myRG" -Name "myPolicy" -Location "eastus" -DetectionRule @($tcpRule, $udpRule, $tcpSynRule)

This example creates a DDoS custom policy with three detection rules for different traffic types.

Example 3: Create a DDoS custom policy with tags

$rule = New-AzDdosCustomPolicyDetectionRule -Name "tcpRule1" -TrafficType Tcp -PacketsPerSecond 1000000
$tags = @{"Environment" = "Production"; "Owner" = "NetworkTeam"}
$policy = New-AzDdosCustomPolicy -ResourceGroupName "myRG" -Name "myPolicy" -Location "eastus" -DetectionRule @($rule) -Tag $tags

This example creates a DDoS custom policy with tags for resource management.

Parameters

-AcquirePolicyToken

Acquire an Azure Policy token automatically for this resource operation.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-AsJob

Run cmdlet in the background.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ChangeReference

The change reference resource ID for this resource operation.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Confirm

Prompts you for confirmation before running the cmdlet.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:cf

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-DefaultProfile

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

Parameter properties

Type:IAzureContextContainer
Default value:None
Supports wildcards:False
DontShow:False
Aliases:AzContext, AzureRmContext, AzureCredential

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-DetectionRule

Specifies DDoS detection rules for the policy. Use New-AzDdosCustomPolicyDetectionRule to create detection rules.

Parameter properties

Type:

Microsoft.Azure.Commands.Network.Models.PSDdosCustomPolicyDetectionRule[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Location

Specifies the location of the DDoS custom policy.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-Name

Specifies the name of the DDoS custom policy to be created.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:ResourceName

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-ResourceGroupName

Specifies the resource group of the DDoS custom policy to be created.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-Tag

Specifies a hash table with resource tags.

Parameter properties

Type:Hashtable
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-WhatIf

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

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:wi

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Outputs

Microsoft.Azure.Commands.Network.Models.PSDdosCustomPolicy