Set-AzureAclConfig
Syntax
Set-AzureAclConfig
[-Action] <String>
[-RemoteSubnet] <String>
[[-Order] <Int32>]
[[-Description] <String>]
-ACL <NetworkAclObject>
[-AddRule]
[-InformationAction <ActionPreference>]
[-InformationVariable <String>]
[<CommonParameters>]
Set-AzureAclConfig
[[-Action] <String>]
[-RuleId] <Int32>
[[-RemoteSubnet] <String>]
[[-Order] <Int32>]
[[-Description] <String>]
-ACL <NetworkAclObject>
[-InformationAction <ActionPreference>]
[-InformationVariable <String>]
[-SetRule]
[<CommonParameters>]
Set-AzureAclConfig
[-RuleId] <Int32>
-ACL <NetworkAclObject>
[-InformationAction <ActionPreference>]
[-InformationVariable <String>]
[-RemoveRule]
[<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.
Required Parameters
Specifies an ACL configuration object that this cmdlet modifies.
| Type: | NetworkAclObject |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | True (ByValue) |
| Accept wildcard characters: | False |
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 |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Indicates that this cmdlet adds a rule to the ACL configuration.
| Type: | SwitchParameter |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
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 |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Indicates that this cmdlet removes a rule from the ACL configuration.
| Type: | SwitchParameter |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Specifies the ID of the rule that this cmdlet removes or modifies for the ACL configuration.
| Type: | Int32 |
| Position: | 0 |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Indicates that this cmdlet modifies a rule in the ACL configuration.
| Type: | SwitchParameter |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Optional Parameters
Specifies a description for the rule that this cmdlet adds or modifies.
| Type: | String |
| Position: | 3 |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
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 |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Specifies an information variable.
| Type: | String |
| Aliases: | iv |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Specifies the processing order for the rule that this cmdlet adds or modifies.
| Type: | Int32 |
| Position: | 2 |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |