Azure - Connect ExpressRoute from a different subscription
- Login-AzureRmAccount
- Select-AzureRmSubscription -SubscriptionId SUB_THAT_HAS_THE_EXPRESSROUTE_CIRCUIT
- $circuit = Get-AzureRmExpressRouteCircuit -Name "ExpressRoute-Sydney-ARM-Private" -ResourceGroupName "Azure-rgrp-ProdPrivate"
- Add-AzureRmExpressRouteCircuitAuthorization -ExpressRouteCircuit $circuit -Name "ClientConnect-AustraliaEast-Internal-Auth"
- Set-AzureRmExpressRouteCircuit -ExpressRouteCircuit $circuit
- select-azurermsubscription -SubscriptionId SUB_THAT_WANTS_TO_CONNECT
- $id = "/subscriptions/xxxxxxxx-8cd4-40ea-876c-be3bdf0a89af/resourceGroups/Azure-rgrp-ProdPrivate/providers/Microsoft.Network/expressRouteCircuits/ExpressRoute-Sydney-ARM-Private"
- $gw = Get-AzureRmVirtualNetworkGateway -Name "CC-AustraliaEast-Internal-vnetgw" -ResourceGroupName "CC-Prod-Private"
- $connection = New-AzureRmVirtualNetworkGatewayConnection -Name "ExpressRoute-Sydney-Connection-CC-AE" -ResourceGroupName "CC-Prod-Private" -Location "AustraliaEast" -VirtualNetworkGateway1 $gw -PeerId $id -ConnectionType ExpressRoute -AuthorizationKey "xxxxxx-92a1-48b4-a520-ea02f8ec2acf"
No comments:
Post a Comment