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

Set-AzureAclConfig
   [-AddRule]
   [-Action] <String>
   [-RemoteSubnet] <String>
   [[-Order] <Int32>]
   [[-Description] <String>]
   -ACL <NetworkAclObject>
   [-InformationAction <ActionPreference>]
   [-InformationVariable <String>]
   [<CommonParameters>]
Set-AzureAclConfig
   [-RemoveRule]
   [-RuleId] <Int32>
   -ACL <NetworkAclObject>
   [-InformationAction <ActionPreference>]
   [-InformationVariable <String>]
   [<CommonParameters>]
Set-AzureAclConfig
   [-SetRule]
   [-RuleId] <Int32>
   [[-Action] <String>]
   [[-RemoteSubnet] <String>]
   [[-Order] <Int32>]
   [[-Description] <String>]
   -ACL <NetworkAclObject>
   [-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.

Type:NetworkAclObject
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-Action

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

Type:String
Position:0
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-AddRule

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

Type:SwitchParameter
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-Description

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

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

-InformationAction

Specifies how this cmdlet responds to an information event.

The acceptable values for this parameter are:

  • Continue
  • Ignore
  • Inquire
  • SilentlyContinue
  • Stop
  • Suspend
Type:ActionPreference
Aliases:infa
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-InformationVariable

Specifies an information variable.

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

-Order

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

Type:Int32
Position:2
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-RemoteSubnet

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

Type:String
Position:1
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-RemoveRule

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

Type:SwitchParameter
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-RuleId

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

Type:Int32
Position:0
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-SetRule

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

Type:SwitchParameter
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False