MSDN Documentation

Explore the depths of Microsoft technologies.

Virtual Network Concepts

A virtual network (VNet) is a logical representation of a physical network that is implemented in software. Virtual networks enable you to securely and reliably connect Azure resources to each other, to the internet, and to your on-premises networks.

Key Components of a Virtual Network

Why Use Virtual Networks?

Common Scenarios

Did you know? You can peer VNets together to allow resources in different virtual networks to communicate with each other. This is a powerful way to create complex, interconnected cloud environments.

Example: Creating a Basic Virtual Network

Here's a conceptual example of how you might define a virtual network and a subnet using Azure CLI:


# Define variables
RESOURCE_GROUP="myResourceGroup"
LOCATION="eastus"
VNET_NAME="myVNet"
SUBNET_NAME="mySubnet"
ADDRESS_PREFIX="10.0.0.0/16"
SUBNET_PREFIX="10.0.0.0/24"

# Create a resource group if it doesn't exist
az group create --name $RESOURCE_GROUP --location $LOCATION

# Create the virtual network
az network vnet create \
  --resource-group $RESOURCE_GROUP \
  --name $VNET_NAME \
  --address-prefix $ADDRESS_PREFIX

# Create a subnet within the virtual network
az network vnet subnet create \
  --resource-group $RESOURCE_GROUP \
  --vnet-name $VNET_NAME \
  --name $SUBNET_NAME \
  --address-prefix $SUBNET_PREFIX

        

Further Reading