Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -702,8 +702,8 @@ function Test-ExpressRouteCircuitConnectionIPv6CRUD
$secondaryPeerAddressPrefixV6 = "bb:cc:dd::/126"

#$peeringLocation = ""
$peeringLocation = "Boydton 1 dc"
$serviceProviderName = "bvtazureixp01"
$peeringLocation = "Boydton cbn"
$serviceProviderName = "bvtcustomerixp01"

try
{
Expand Down Expand Up @@ -866,6 +866,21 @@ function Test-ExpressRouteCircuitConnectionIPv6CRUD
Assert-AreEqual "Connected" $peerCkt.Peerings[0].PeeredConnections[0].CircuitConnectionStatus

#Delete the circuit connection Resource
Remove-AzExpressRouteCircuitConnectionConfig -Name $connectionName -ExpressRouteCircuit $initCkt -AddressPrefixType IPv6

#Set on Express Route Circuit
Set-AzExpressRouteCircuit -ExpressRouteCircuit $initCkt

#Get Express Route Circuit Resource
$initCkt = Get-AzExpressRouteCircuit -Name $initCircuitName -ResourceGroupName $rgname
$initCkt

#Verify Global reach enabled readonly flag
Assert-AreEqual $true $initckt.GlobalReachEnabled

#Verify Circuit Connection does not exist
Assert-AreEqual 1 $initckt.Peerings[0].Connections.Count

Remove-AzExpressRouteCircuitConnectionConfig -Name $connectionName -ExpressRouteCircuit $initCkt

#Set on Express Route Circuit
Expand Down

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions src/Network/Network/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
--->

## Upcoming Release
* Added support for AddressPrefixType parameter to `Remove-AzExpressRouteCircuitConnectionConfig

* Added name validation for `New-AzIpGroup`

## Version 3.0.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,16 @@ public class RemoveAzureExpressRouteCircuitConnectionConfigCommand : ExpressRout
[ValidateNotNullOrEmpty]
public PSExpressRouteCircuit ExpressRouteCircuit { get; set; }

[Parameter(
Mandatory = false,
HelpMessage = "The Address family of the Circuit Connection")]
[ValidateSet(
IPv4,
IPv6,
IgnoreCase = true)]
public string AddressPrefixType { get; set; }


public override void Execute()
{
base.Execute();
Expand All @@ -59,7 +69,21 @@ public override void Execute()

if (connection != null)
{
peering.Connections.Remove(connection);
if (!string.IsNullOrWhiteSpace(this.AddressPrefixType))
{
if (this.AddressPrefixType == IPv4)
{
connection.AddressPrefix = null;
}
if (this.AddressPrefixType == IPv6)
{
connection.IPv6CircuitConnectionConfig = null;
}
}
else
{
peering.Connections.Remove(connection);
}
}

WriteObject(this.ExpressRouteCircuit);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,18 @@ Set-AzExpressRouteCircuit -ExpressRouteCircuit $circuit_init
Get-AzExpressRouteCircuit -Name $initiatingCircuitName -ResourceGroupName $rg|Remove-AzExpressRouteCircuitConnectionConfig -Name $circuitConnectionName|Set-AzExpressRouteCircuit
```

### Example 3: Remove a circuit connection configuration from an ExpressRoute circuit for a specific address family
```
$circuit_init = Get-AzExpressRouteCircuit -Name $initiatingCircuitName -ResourceGroupName $rg
Remove-AzExpressRouteCircuitConnectionConfig -Name $circuitConnectionName -ExpressRouteCircuit $circuit_init -AddressPrefixType IPv4
Set-AzExpressRouteCircuit -ExpressRouteCircuit $circuit_init
```

### Example 4: Remove a circuit connection configuration using Piping from an ExpressRoute Circuit for a specific address family
```
Get-AzExpressRouteCircuit -Name $initiatingCircuitName -ResourceGroupName $rg|Remove-AzExpressRouteCircuitConnectionConfig -Name $circuitConnectionName -AddressPrefixType IPv6|Set-AzExpressRouteCircuit
```

## PARAMETERS

### -DefaultProfile
Expand Down Expand Up @@ -82,6 +94,21 @@ Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -AddressPrefixType
Specifies the address family that needs to be removed from the config

```yaml
Type: System.String
Parameter Sets: (All)
Aliases:
Accepted values: IPv4, IPv6

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -Confirm
Prompts you for confirmation before running the cmdlet.
Expand Down