Connecting to VMs on different Sub and RG! How is this done?
-
Hi, Hope all are keeping safe and well. I would be greatful if I could get some help with the following deployment scenario. I am planning a proof of concept on paper and I need some expertise in relation to connecting two VM's together that have different subscriptions and RG's.
.
I have an existing production environment, that is in a Resource Group A, on Subscription: A, located in Region A, on a Virtual Network A. The production environment exists on 10.0.255.0/24I want to create a Test Environment separate from the Production Environment but has access to the Production Environment, so that I can access file shares and add to the domain. I also want to have a separate subscription: B for this test environment & resource group: B. At some point i need to also add Windows Virtual Desktops. Essentially I am creating a proof of concept. Deploying an application to multiple users. I would like this environment ring fenced from the production environment, for various reasons, namely the ability to manage costs, budgets, configure, delete and redeploy etc..I dont have this with the Production Environment has this is under a CSP Plan and I have limited access.
When I go and create the Virtual Machine, I choose the Sub: B, I choose the RG: B, etc... When I go to networking, It doesn't display the Virtual Network A from the Prod. environment. I guess this makes sense has this is on a different subscription and RG.
So if I create new virtual network:
:Q: What do I insert here and how do I link the two networks together so that they can see each other. Apologies if this is a question that I should have the answer to, as I slowly work my way through Cloud Certification I will hit the Network+ and CCNA certs.
Many thanks.
Ryan.
-
@Ryan-Kular Sorry title should say "Connecting two VMs on different Sub. and RG! How is this done?" has opposed to "to"
-
Hey @Ryan-Kular,
Hope you are doing well and staying safe also!
The solution you are looking for is VNet peering. This allows you to connect two virtual networks that exist in different subscriptions.
Rather than connect a VM from one subscription to a VNet in another subscription, you will connect the two VNets from each subscription so they can communicate with each other.
The steps are different depending on what deployment method you used to create the virtual networks.
This link is for peering two virtual networks that were both deployed using Resource Manager, but exist in different subscriptions.
https://docs.microsoft.com/en-us/azure/virtual-network/create-peering-different-subscriptions
I believe that is what you are describing.
Let me know if you need more info,
-
Brilliant. It is VNET peering. I created a test environment in Azure and was able to use VNet peering to connect the two VNETs together. Just got to remember that VNETs cannot span subscriptions and regions.
Thanks Mike.