Edit

Set-AzDdosCustomPolicyDetectionRule

Updates an existing detection rule on a DDoS custom policy object.

Syntax

Default (Default)

Set-AzDdosCustomPolicyDetectionRule
    -DdosCustomPolicy <PSDdosCustomPolicy>
    -Name <String>
    [-TrafficType <String>]
    [-PacketsPerSecond <Int32>]
    [-DefaultProfile <IAzureContextContainer>]
    [-AcquirePolicyToken]
    [-ChangeReference <String>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

The Set-AzDdosCustomPolicyDetectionRule cmdlet updates an existing detection rule selected by its case-insensitive name. You can specify TrafficType, PacketsPerSecond, or both. Properties that are not specified retain their current values. If neither property is specified, the detection rule remains unchanged and the policy object is returned.

The cmdlet updates the supplied policy object. Pass the updated policy to Set-AzDdosCustomPolicy to persist the changes to Azure.

Examples

Example 1: Update the packet threshold

$policy = Get-AzDdosCustomPolicy -ResourceGroupName "myRG" -Name "myPolicy"
$policy = $policy |
    Set-AzDdosCustomPolicyDetectionRule -Name "tcpRule" -PacketsPerSecond 120000

This example updates the packet threshold of tcpRule while preserving its traffic type.

Example 2: Update the traffic type

$policy = $policy |
    Set-AzDdosCustomPolicyDetectionRule -Name "tcpRule" -TrafficType TcpSyn

This example changes the traffic type of tcpRule to TcpSyn. A policy can contain only one detection rule for each traffic type.

Example 3: Return the policy without changing the detection rule

$policy = $policy |
    Set-AzDdosCustomPolicyDetectionRule -Name "tcpRule"

This example returns the policy object without changing tcpRule because neither TrafficType nor PacketsPerSecond is specified.

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

-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

-DdosCustomPolicy

Specifies the DDoS custom policy object containing the detection rule to update.

Parameter properties

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

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:True
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

-Name

Specifies the name of the detection rule to update. Name matching is case-insensitive.

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:False
Value from remaining arguments:False

-PacketsPerSecond

Specifies the updated packets per second threshold. If omitted, the existing threshold is preserved.

Parameter properties

Type:Int32
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

-TrafficType

Specifies the updated traffic type. Allowed values are Tcp, Udp, and TcpSyn. If omitted, the existing traffic type is preserved.

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

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.

Inputs

PSDdosCustomPolicy

Outputs

PSDdosCustomPolicy