Add-AzDdosCustomPolicyDetectionRule
Adds a detection rule to an in-memory DDoS custom policy.
Syntax
Default (Default)
Add-AzDdosCustomPolicyDetectionRule
-DdosCustomPolicy <PSDdosCustomPolicy>
-Name <String>
-TrafficType <String>
-PacketsPerSecond <Int32>
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[-AcquirePolicyToken]
[-ChangeReference <String>]
[<CommonParameters>]
Description
The Add-AzDdosCustomPolicyDetectionRule cmdlet adds a detection rule to a DDoS custom policy object in memory. After adding the rule, use Set-AzDdosCustomPolicy to persist the updated policy to Azure.
This follows the same mutation-on-parent workflow used by Load Balancer child configuration cmdlets, where the child configuration is added to the local parent object first and then saved with the parent Set cmdlet.
Examples
Example 1: Add a detection rule and persist the change
Get-AzDdosCustomPolicy -ResourceGroupName "myRG" -Name "myPolicy" |
Add-AzDdosCustomPolicyDetectionRule -Name "tcpSynRule1" -TrafficType TcpSyn -PacketsPerSecond 50000 |
Set-AzDdosCustomPolicy
This example gets an existing DDoS custom policy, adds a TCP SYN detection rule to the in-memory policy object, and then persists the updated policy to Azure.
Example 2: Add a detection rule to a local policy object
$policy = Get-AzDdosCustomPolicy -ResourceGroupName "myRG" -Name "myPolicy"
$updatedPolicy = $policy | Add-AzDdosCustomPolicyDetectionRule -Name "udpRule1" -TrafficType Udp -PacketsPerSecond 100000
This example updates only the local policy object. The change is not sent to Azure until Set-AzDdosCustomPolicy is called.
Example 3: Preview an add operation
$policy = Get-AzDdosCustomPolicy -ResourceGroupName "myRG" -Name "myPolicy"
$policy | Add-AzDdosCustomPolicyDetectionRule -Name "tcpRule1" -TrafficType Tcp -PacketsPerSecond 1000000 -WhatIf
This example shows the add operation without applying the change.
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
-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
-DdosCustomPolicy
Specifies the DDoS custom policy object to update in memory.
Parameter properties
Type: Microsoft.Azure.Commands.Network.Models.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 add.
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 packets-per-second threshold for the detection rule being added.
Parameter properties
Type: Int32
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
-TrafficType
Specifies the traffic type for the detection rule. Accepted values are Tcp, Udp, and TcpSyn.
Parameter properties
Type: String
Default value: None
Accepted values: Tcp, Udp, TcpSyn
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
-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 .
Microsoft.Azure.Commands.Network.Models.PSDdosCustomPolicy
Outputs
Microsoft.Azure.Commands.Network.Models.PSDdosCustomPolicy