Remove-AzExpressRouteConnection
Remove um ExpressRouteConnection.
Sintaxe
Remove-AzExpressRouteConnection
-ResourceGroupName <String>
-ExpressRouteGatewayName <String>
-Name <String>
[-Force]
[-PassThru]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Remove-AzExpressRouteConnection
-ResourceId <String>
[-Force]
[-PassThru]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Remove-AzExpressRouteConnection
-InputObject <PSExpressRouteConnection>
[-Force]
[-PassThru]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
Remove um ExpressRouteConnection.
Exemplos
Exemplo 1
New-AzResourceGroup -Location "West Central US" -Name "testRG"
$virtualWan = New-AzVirtualWan -ResourceGroupName testRG -Name myVirtualWAN -Location "West Central US"
$virtualHub = New-AzVirtualHub -VirtualWan $virtualWan -ResourceGroupName "testRG" -Name "westushub" -AddressPrefix "10.0.0.1/24"
New-AzExpressRouteGateway -ResourceGroupName "testRG" -Name "testExpressRoutegw" -VirtualHubId $virtualHub.Id -MinScaleUnits 2
$ExpressRouteGateway = Get-AzExpressRouteGateway -ResourceGroupName "testRG" -Name "testExpressRoutegw"
$ExpressRouteCircuit = New-AzExpressRouteCircuit -ResourceGroupName "testRG" -Name "testExpressRouteCircuit" -Location "West Central US" -SkuTier Premium -SkuFamily MeteredData -ServiceProviderName "Equinix" -PeeringLocation "Silicon Valley" -BandwidthInMbps 200
Add-AzExpressRouteCircuitPeeringConfig -Name "AzurePrivatePeering" -ExpressRouteCircuit $ExpressRouteCircuit -PeeringType AzurePrivatePeering -PeerASN 100 -PrimaryPeerAddressPrefix "123.0.0.0/30" -SecondaryPeerAddressPrefix "123.0.0.4/30" -VlanId 300
$ExpressRouteCircuit = Set-AzExpressRouteCircuit -ExpressRouteCircuit $ExpressRouteCircuit
$ExpressRouteCircuitPeeringId = $ExpressRouteCircuit.Peerings[0].Id
New-AzExpressRouteConnection -ResourceGroupName $ExpressRouteGateway.ResourceGroupName -ExpressRouteGatewayName $ExpressRouteGateway.Name -Name "testConnection" -ExpressRouteCircuitPeeringId $ExpressRouteCircuitPeeringId -RoutingWeight 20
Remove-AzExpressRouteConnection -ResourceGroupName $ExpressRouteGateway.ResourceGroupName -ExpressRouteGatewayName $ExpressRouteGateway.Name -Name "testConnection"
O acima criará um grupo de recursos, WAN Virtual, Rede Virtual, Hub Virtual no Oeste dos EUA no grupo de recursos "testRG" no Azure. Um gateway ExpressRoute será criado posteriormente no Hub Virtual com 2 unidades de escala.
Depois que o gateway for criado, ele será conectado ao ExpressRouteSite usando o comando New-AzExpressRouteConnection.
Em seguida, ele remove a conexão usando o nome da conexão.
Exemplo 2
New-AzResourceGroup -Location "West Central US" -Name "testRG"
$virtualWan = New-AzVirtualWan -ResourceGroupName testRG -Name myVirtualWAN -Location "West Central US"
$virtualHub = New-AzVirtualHub -VirtualWan $virtualWan -ResourceGroupName "testRG" -Name "westushub" -AddressPrefix "10.0.0.1/24"
New-AzExpressRouteGateway -ResourceGroupName "testRG" -Name "testExpressRoutegw" -VirtualHubId $virtualHub.Id -MinScaleUnits 2
$ExpressRouteGateway = Get-AzExpressRouteGateway -ResourceGroupName "testRG" -Name "testExpressRoutegw"
$ExpressRouteCircuit = New-AzExpressRouteCircuit -ResourceGroupName "testRG" -Name "testExpressRouteCircuit" -Location "West Central US" -SkuTier Premium -SkuFamily MeteredData -ServiceProviderName "Equinix" -PeeringLocation "Silicon Valley" -BandwidthInMbps 200
Add-AzExpressRouteCircuitPeeringConfig -Name "AzurePrivatePeering" -ExpressRouteCircuit $ExpressRouteCircuit -PeeringType AzurePrivatePeering -PeerASN 100 -PrimaryPeerAddressPrefix "123.0.0.0/30" -SecondaryPeerAddressPrefix "123.0.0.4/30" -VlanId 300
$ExpressRouteCircuit = Set-AzExpressRouteCircuit -ExpressRouteCircuit $ExpressRouteCircuit
$ExpressRouteCircuitPeeringId = $ExpressRouteCircuit.Peerings[0].Id
New-AzExpressRouteConnection -ResourceGroupName $ExpressRouteGateway.ResourceGroupName -ExpressRouteGatewayName $ExpressRouteGateway.Name -Name "testConnection" -ExpressRouteCircuitPeeringId $ExpressRouteCircuitPeeringId -RoutingWeight 20
Get-AzExpressRouteConnection -ResourceGroupName $ExpressRouteGateway.ResourceGroupName -ExpressRouteGatewayName $ExpressRouteGateway.Name -Name "testConnection" | Remove-AzExpressRouteConnection
O mesmo que o exemplo 1, mas agora remove a conexão usando o objeto canalizado de Get-AzExpressRouteConnection.
Parâmetros
-Confirm
Solicita a sua confirmação antes de executar o cmdlet.
Tipo: | SwitchParameter |
Aliases: | cf |
Position: | Named |
Default value: | None |
Necessário: | False |
Aceitar entrada de pipeline: | False |
Aceitar carateres universais: | False |
-DefaultProfile
As credenciais, a conta, o locatário e a assinatura usados para comunicação com o Azure.
Tipo: | IAzureContextContainer |
Aliases: | AzContext, AzureRmContext, AzureCredential |
Position: | Named |
Default value: | None |
Necessário: | False |
Aceitar entrada de pipeline: | False |
Aceitar carateres universais: | False |
-ExpressRouteGatewayName
O nome do recurso pai.
Tipo: | String |
Position: | Named |
Default value: | None |
Necessário: | True |
Aceitar entrada de pipeline: | False |
Aceitar carateres universais: | False |
-Force
Não peça confirmação se quiser substituir um recurso
Tipo: | SwitchParameter |
Position: | Named |
Default value: | None |
Necessário: | False |
Aceitar entrada de pipeline: | False |
Aceitar carateres universais: | False |
-InputObject
O objeto ExpressRouteConnection a ser atualizado.
Tipo: | PSExpressRouteConnection |
Aliases: | ExpressRouteConnection |
Position: | Named |
Default value: | None |
Necessário: | True |
Aceitar entrada de pipeline: | True |
Aceitar carateres universais: | False |
-Name
O nome do recurso.
Tipo: | String |
Aliases: | ResourceName, ExpressRouteConnectionName |
Position: | Named |
Default value: | None |
Necessário: | True |
Aceitar entrada de pipeline: | False |
Aceitar carateres universais: | False |
-PassThru
Retorna um objeto que representa o item com o qual você está trabalhando. Por padrão, esse cmdlet não gera nenhuma saída.
Tipo: | SwitchParameter |
Position: | Named |
Default value: | None |
Necessário: | False |
Aceitar entrada de pipeline: | False |
Aceitar carateres universais: | False |
-ResourceGroupName
O nome do grupo de recursos.
Tipo: | String |
Position: | Named |
Default value: | None |
Necessário: | True |
Aceitar entrada de pipeline: | False |
Aceitar carateres universais: | False |
-ResourceId
A id do recurso do objeto ExpressRouteConnection a ser excluído.
Tipo: | String |
Aliases: | ExpressRouteConnectionId |
Position: | Named |
Default value: | None |
Necessário: | True |
Aceitar entrada de pipeline: | True |
Aceitar carateres universais: | False |
-WhatIf
Apresenta o que aconteceria mediante a execução do cmdlet. O cmdlet não é executado.
Tipo: | SwitchParameter |
Aliases: | wi |
Position: | Named |
Default value: | None |
Necessário: | False |
Aceitar entrada de pipeline: | False |
Aceitar carateres universais: | False |