Set-​Azure​Network​Security​Rule

Adds or modifies a network security rule in a network security group.

Syntax

Set-AzureNetworkSecurityRule
   -Action <String>
   -DestinationAddressPrefix <String>
   -DestinationPortRange <String>
   -Name <String>
   -NetworkSecurityGroup <INetworkSecurityGroup>
   -Priority <Int32>
   [-Profile <AzureSMProfile>]
   -Protocol <String>
   -SourceAddressPrefix <String>
   -SourcePortRange <String>
   -Type <String>
   [<CommonParameters>]

Description

The Set-AzureNetworkSecurityRule cmdlet adds or modifies an Azure network security rule in a network security group.

Required Parameters

-Action

Specifies the action for a network security rule. Valid values are: Allow and Deny.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-DestinationAddressPrefix

Specifies the Classless Interdomain Routing (CIDR) address of the destination IP range for the network security rule. An asterisk (*) specifies any IP address.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-DestinationPortRange

Specifies a destination port range for the network security rule. Valid values consist of integers from 0 to 65535. You can specify an individual value, or specify a range in the format LowerNumber-HigherNumber. A hyphen separates the two values.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Name

Specifies the name for the network security rule that this cmdlet adds or modifies.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-NetworkSecurityGroup

Specifies the network security group that this cmdlet modifies. To obtain an INetworkSecurityGroup object, use the Get-AzureNetworkSecurityGroup cmdlet.

Type:INetworkSecurityGroup
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName, ByValue)
Accept wildcard characters:False
-Priority

Specifies the priority for the network security rule. Valid values are: integers from 100 to 4096.

Type:Int32
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Protocol

Specifies the protocol for the network security rule. Valid values are:

  • TCP
  • UDP
  • *
Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-SourceAddressPrefix

Specifies the CIDR address of the source IP range for the network security rule. An asterisk (*) specifies any IP address.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-SourcePortRange

Specifies a source port range for the network security rule. Valid values consist of integers from 0 to 65535. You can specify an individual value, or specify a range in the format LowerNumber-HigherNumber. A hyphen separates the two values.

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

Specifies the type of connection for the network security rule. Valid values are: Inbound and Outbound.

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

Optional Parameters

-Profile

Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile.

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