Wednesday, May 11, 2016

Azure - Connect ExpressRoute from a different subscription

  1. Login-AzureRmAccount
  2. Select-AzureRmSubscription -SubscriptionId SUB_THAT_HAS_THE_EXPRESSROUTE_CIRCUIT
  3. $circuit = Get-AzureRmExpressRouteCircuit -Name "ExpressRoute-Sydney-ARM-Private" -ResourceGroupName "Azure-rgrp-ProdPrivate"
  4. Add-AzureRmExpressRouteCircuitAuthorization -ExpressRouteCircuit $circuit -Name "ClientConnect-AustraliaEast-Internal-Auth"
  5. Set-AzureRmExpressRouteCircuit -ExpressRouteCircuit $circuit

  1. select-azurermsubscription -SubscriptionId SUB_THAT_WANTS_TO_CONNECT
  2. $id = "/subscriptions/xxxxxxxx-8cd4-40ea-876c-be3bdf0a89af/resourceGroups/Azure-rgrp-ProdPrivate/providers/Microsoft.Network/expressRouteCircuits/ExpressRoute-Sydney-ARM-Private"  
  3. $gw = Get-AzureRmVirtualNetworkGateway -Name "CC-AustraliaEast-Internal-vnetgw" -ResourceGroupName "CC-Prod-Private"
  4. $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: