Advertisement
Guest User

Untitled

a guest
Jul 25th, 2017
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. # Set up vnet perring between the classic and ARM vnet
  2. $resourceGroupName = 'domain-services-rg'
  3. $classicVnetName = 'domain-services-vnet'
  4. # Enter the name of the AzureRM subscription the VNETs are deployed in. Run (Get-AzureRmSubscription).SubscriptionName after authenticating to AzureRM
  5. $subScriptionName = ''
  6.  
  7. # save current vnet in var
  8. $vnet = Get-AzureRmVirtualNetwork -Name northeurope-vnet -ResourceGroupName domain-services-rg
  9.  
  10. # create the id for the classic vnet - we need the subscription id, resource group name and classic vnet to form the id
  11. $subscriptionId = (Get-AzureRmSubscription -SubscriptionName $subScriptionName).SubscriptionId
  12. $id = "/subscriptions/$subscriptionId/resourceGroups/$resourceGroupName/providers/Microsoft.ClassicNetwork/virtualNetworks/$classicVnetName"
  13.  
  14. Add-AzureRmVirtualNetworkPeering -Name domain-service-peering -VirtualNetwork $vnet -RemoteVirtualNetworkId $id
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement