Edit

Share via


Set-AzureAclConfig

Modifies an ACL configuration object.

Note

The cmdlets referenced in this documentation are for managing legacy Azure resources that use Azure Service Manager (ASM) APIs. This legacy PowerShell module isn't recommended when creating new resources since ASM is scheduled for retirement. For more information, see Azure Service Manager retirement.

The Az PowerShell module is the recommended PowerShell module for managing Azure Resource Manager (ARM) resources with PowerShell.

Syntax

AddRule

Set-AzureAclConfig
    [-Action] <String>
    [-RemoteSubnet] <String>
    [[-Order] <Int32>]
    [[-Description] <String>]
    -ACL <NetworkAclObject>
    [-AddRule]
    [-InformationAction <ActionPreference>]
    [-InformationVariable <String>]
    [<CommonParameters>]

RemoveRule

Set-AzureAclConfig
    [-RuleId] <Int32>
    -ACL <NetworkAclObject>
    [-RemoveRule]
    [-InformationAction <ActionPreference>]
    [-InformationVariable <String>]
    [<CommonParameters>]

SetRule

Set-AzureAclConfig
    [-RuleId] <Int32>
    [[-Action] <String>]
    [[-RemoteSubnet] <String>]
    [[-Order] <Int32>]
    [[-Description] <String>]
    -ACL <NetworkAclObject>
    [-SetRule]
    [-InformationAction <ActionPreference>]
    [-InformationVariable <String>]
    [<CommonParameters>]

Description

The Set-AzureAclConfig cmdlet modifies an access control list (ACL) configuration object from an existing Azure virtual machine configuration.

Examples

Example 1: Add a rule to a new ACL configuration

PS C:\> $Acl = New-AzureAclConfig
PS C:\> Set-AzureAclConfig -AddRule -ACL $Acl -Action Permit -RemoteSubnet "172.0.0.0/8" -Order 100 -Description "Permit ACL rule"

The first command creates an ACL configuration, and then stores it in the $Acl variable.

The second command adds a new rule to the configuration stored in $Acl. The command specifies an action, subnet, order, and description for the rule.

Example 2: Modify a rule in an ACL configuration

PS C:\> $Acl = Get-AzureVM -ServiceName "ContosoService" -Name "VirtualMachine07" | Get-AzureAclConfig -EndpointName "Web"
PS C:\> Set-AzureAclConfig -SetRule -RuleId 0 -ACL $Acl -Order 102 -Description "Web endpoint rule"
PS C:\> Get-AzureVM -ServiceName "ContosoService" -Name "VirtualMachine07" | Set-AzureEndpoint -ACL $Acl -Name "Web" | Update-AzureVM

The first command gets the virtual machine named VirtualMachine07 in the service named ContosoService by using the Get-AzureVM cmdlet. The command passes that object to the Get-AzureAclConfig cmdlet by using the pipeline operator. That cmdlet gets the ACL configuration for the endpoint named Web. The command stores that ACL configuration object in the $Acl variable.

The second command modifies the rule that has the ID of 0. The command changes the order and the description of the rule.

The final command sets the ACL configuration object for that virtual machine by using the Set-AzureEndpoint cmdlet. The command also updates that virtual machine.

Example 3: Remove a rule from an ACL configuration

PS C:\> $Acl = Get-AzureVM -ServiceName "ContosoService" -Name "VirtualMachine07" | Get-AzureAclConfig -EndpointName "Web"
PS C:\> Set-AzureAclConfig -RemoveRule -ID 0 -ACL $Acl
PS C:\> Get-AzureVM -ServiceName "ContosoService" -Name "VirtualMachine07" | Set-AzureEndpoint -ACL $Acl -Name "Web" | Update-AzureVM

The first command stores an ACL configuration object in the $Acl variable. This is the same as the previous example.

The second command removes the rule that has the ID 0 from the ACL configuration in $Acl.

The final command sets the ACL configuration object for the virtual machine and updates that virtual machine. This is the same as the previous example.

Parameters

-ACL

Specifies an ACL configuration object that this cmdlet modifies.

Parameter properties

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

-Action

Specifies the action for the rule that this cmdlet adds or modifies. Valid values are: Permit and Deny.

Parameter properties

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

Parameter sets

AddRule
Position:0
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-AddRule

Indicates that this cmdlet adds a rule to the ACL configuration.

Parameter properties

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

Parameter sets

AddRule
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Description

Specifies a description for the rule that this cmdlet adds or modifies.

Parameter properties

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

Parameter sets

AddRule
Position:3
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
SetRule
Position:3
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-InformationAction

Specifies how this cmdlet responds to an information event.

The acceptable values for this parameter are:

  • Continue
  • Ignore
  • Inquire
  • SilentlyContinue
  • Stop
  • Suspend

Parameter properties

Type:ActionPreference
Default value:None
Supports wildcards:False
DontShow:False
Aliases:infa

Parameter sets

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

-InformationVariable

Specifies an information variable.

Parameter properties

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

Parameter sets

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

-Order

Specifies the processing order for the rule that this cmdlet adds or modifies.

Parameter properties

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

Parameter sets

AddRule
Position:2
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
SetRule
Position:2
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-RemoteSubnet

Specifies the remote subnet for the rule that this cmdlet adds or modifies. Specifies an address in Classless Interdomain Routing (CIDR) format.

Parameter properties

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

Parameter sets

AddRule
Position:1
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-RemoveRule

Indicates that this cmdlet removes a rule from the ACL configuration.

Parameter properties

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

Parameter sets

RemoveRule
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-RuleId

Specifies the ID of the rule that this cmdlet removes or modifies for the ACL configuration.

Parameter properties

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

Parameter sets

RemoveRule
Position:0
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
SetRule
Position:0
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-SetRule

Indicates that this cmdlet modifies a rule in the ACL configuration.

Parameter properties

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

Parameter sets

SetRule
Position:Named
Mandatory:True
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.