Azure VNET peering between ASM and ARM VNETs

I had case where I needed to have VNET peering between ASM & ARM VNETs in the same Azure Subscription. I will show you the steps what I did.

 

The case was that I had two VNETs in the same Azure subscription:
#VNET1 (ASM) 10.1.0.0/24
#VNET2 (ARM) 10.3.0.0/24

It is also possible to do VNET peering between VNETs in the separated subscriptions, if this is your case please refer following Microsoft article.

The following script will do the trick and it is really quickly done, but please remember to update your Azure Powershell cmdlets to the latest version.

First, login to your Azure subscription and then read your ARM VNET object to the $vnet2 variable.

Then we only need to establish VNET peering between the VNETs.
You can check the RemoteVirtualNetworkId (classic vnet) for example from the portal of the VNET properties:


After you have done the VNET peering you will get the following information:

If you want to remove the peering it is easily done with the following command:

 

 

If you are doing the VNET peering between the different subscriptions you need to register some preview capability in your Azure subscription. Remember to wait until the RPs are in the Registered -state before continue. You can ensure the registering status like this:

 

Leave a Reply

Your email address will not be published. Required fields are marked *