Azure Virtual Networks: The Basics Behind Private Cloud Connectivity
When creating resources in Azure, it is easy to focus on the virtual machine, storage account or application being deployed. But those resources also need a network configuration that controls how they communicate. An A
When creating resources in Azure, it is easy to focus on the virtual machine, storage account or application being deployed. But those resources also need a network configuration that controls how they communicate.
An Azure Virtual Network (VNet) provides a private network boundary for Azure resources. It defines address space and allows resources to communicate with one another, with other networks, or with the internet according to the configuration.
Understanding the basic parts of a VNet makes it easier to plan a deployment and troubleshoot connectivity.
Plan the address space first
A VNet is assigned an address range using CIDR notation. Subnets divide that address space into smaller ranges for different groups of resources.
For example, a practice environment might use a private range such as 10.0.0.0/16 and create separate subnets for application and data resources. The exact ranges should be planned alongside any networks the VNet may need to connect to, so address ranges do not overlap.
Virtual network: 10.0.0.0/16
Subnet: app-subnet 10.0.1.0/24
Subnet: data-subnet 10.0.2.0/24
A subnet is not, by itself, a complete security boundary. Network Security Groups and other controls may be needed to define which traffic is allowed.
Create a VNet and subnet with Azure CLI
The following example creates a resource group, a VNet and an application subnet. The names and address ranges are examples; check that the ranges do not conflict with networks you already use.
az group create \
--name rg-network-demo \
--location uksouth
az network vnet create \
--resource-group rg-network-demo \
--name vnet-demo \
--address-prefixes 10.0.0.0/16 \
--subnet-name app-subnet \
--subnet-prefixes 10.0.1.0/24
You can verify the VNet and its subnets with:
az network vnet show \
--resource-group rg-network-demo \
--name vnet-demo \
--output table
This creates the network structure, but it does not automatically define all the access rules an application needs. Those depend on the resources and traffic paths in your design.
Understand the main components
A basic VNet design may include:
- Address space: The private IP range assigned to the network.
- Subnets: Smaller ranges used to organise resources.
- Network Security Groups: Rules controlling inbound and outbound traffic.
- Routes: Rules that determine where network traffic is sent.
- Connectivity options: Connections to other VNets, on-premises networks or public services, depending on the architecture.
Not every deployment needs every component. The design should reflect what the application needs to communicate with.
Restrict traffic to what is needed
A network configuration should allow required communication without leaving unnecessary access open. For example, an application subnet may need to reach a database subnet on a specific port, while other inbound traffic should be denied.
The exact rules depend on the application and its security requirements. Avoid copying broad rules into production simply because they make a tutorial deployment work.
When troubleshooting, check the full path: the resourceβs network interface, subnet rules, network security rules, routes and any relevant firewall or service settings. A failure at any point can prevent a connection.
Keep the design understandable
Clear subnet names and a simple network diagram can make later changes easier. Documenting the purpose of each subnet and the intended traffic paths helps other people understand why a rule exists.
For a learning environment, start small: define the address range, create a subnet, deploy a test resource and verify connectivity. Add more complex routing or network connections only when there is a clear need.
A VNet is more than a place to attach virtual machines. It is part of how an Azure deployment organises connectivity and controls traffic. Planning the address space and access rules before adding resources can prevent avoidable networking problems later.
Originally published by Dev.to WebDev. Aggregated on AIWithGhost for educational purposes β full credit and traffic to the original publisher.