What is Azure Virtual Network (VNet)?
Definition: Azure Virtual Network allows azure resources like VM, Database, Apps to communicate with each other.
- You can think of Virtual Network as a set of resources that connect other resources.
- This is called a virtual network because you can access the network, but you don’t have any access to the hardware components.
- A VNet belongs to a single region. So, all the resources in a VNet also must be in the same region. You can connect VNets to communicate between Regions.
- One VNet belongs to one/single subscription but One subscription can have multiple VNets.
There are some concepts you need to understand before we dive into VNet.
- IP Address:
- When you send a courier to someone, you write a postal address on it so that the courier company knows exactly where the package needs to be delivered.
- Similarly, every request on the internet has an address (IP address), so that the internet or WWW knows exactly where the response needs to be sent back.
- Address Space:
- An address space is a range of IP addresses that are available.
- Every service or resource that is connected to VNet, will get a unique IP address within the range of address space. That is how services will communicate with each other within the same VNet.
- You assign address space to VNet and all the services, resources connected to that VNet will automatically get an IP address.
- Subnets:
- You can divide a VNet into multiple Subnets. Subnet lets you segment a VNet into smaller networks that make logical sense.
- Each Subnet will get a portion of address space as shown in the screenshot below.
- Because of Subnet, you will have multiple networks on the same VNet.
- This gives some advantages like,
- Resource Grouping: Same services will go together in a single subnet. It will help in keeping track of services.
- Address Allocation: Address allocation becomes more efficient. This is the prime advantage of subnets.
- Subnet Security: You can use a network security group to secure individual subnets.
Azure Virtual Network capabilities and advantages
- You can create multiple isolated Virtual Networks (VNets) using Azure. Resource grouping and Address Allocation come in handy over here.
- You can add more VNets or more addresses as and when required.
- Using Azure VNets, you can connect not only VMs but other services too like Azure Kubernetes Service, Azure VM Scale Set, App service environment for Power Apps, etc.
- Within your Azure subscription, Azure VNets enables you to connect to your On-premises resources also
- You can route and control the traffic between the Subnets using Route Tables and Border Gateway Protocol.
- You can also filter the traffic between the Subnets using Network Security Groups and Network Virtual Appliances.
What is VNet Peering?
- This feature lets you connect two or more VNets in Azure.
- VNet Peering is the fundamental part of using Virtual Networks (VNets).
- Traffic between the Virtual Machines in Peered network uses Private Microsoft backbone network and it never passes through Public Network.
- Peering provides low-latency and high bandwidth connection between the resources in the different Virtual Networks (VNets).
- With the help of Peering, Resource in different VNets can communicate with each other.
- IMP: Using Peering, the users can transfer data between subscriptions, deployment models, and different regions.