In this article we will build an Azure VPN Gateway Basic SKU using Azure CLI.
Note: On September 30, 2025, Basic SKU public IPs & VPN Gateways will be retired. For more information, see the official announcements (Public IP) and (VPN Gateways).
The Basic SKU is the cheapest VPN Gateway SKU (see here for all the different SKUs available). In our Site to site VPN article we used the Portal to build the gateway, but that only allows for the VpnGw1 (or higher) SKU. The basic SKU is great for testing some of the basic features as it is much cheaper.
VNet Creation
CLI command to create a VNet:
az network vnet create --name <VNet Name> --resource-group <RG Name> --address-prefix <address space> --location <region> --subnet-name <subnet name> --subnet-prefix <subnet>
For available values check here
Example:
az network vnet create --name VN-VPN --resource-group RG-VPN --address-prefix 10.0.0.0/16 --location uksouth --subnet-name Subnet1 --subnet-prefix 10.0.0.0/24
Gateway Subnet
Create the Gateway Subnet within the above VNet
az network vnet subnet create --address-prefix <subnet> --name GatewaySubnet --resource-group <RG Name> --vnet-name <VNet Name>
For available values check here
Example:
az network vnet subnet create --address-prefix 10.0.255.0/27 --name GatewaySubnet --resource-group RG-VPN --vnet-name VN-VPN
Public IP Address
For a Basic SKU Virtual Network Gateway you need to use a Basic SKU, Dynamic Public IP address to go with it.
az network public-ip create --name <Public IP name> --resource-group <RG Name> --allocation-method <allocation method> --sku <SKU>
For available values check here
Example:
az network public-ip create --name PIP-VPN --resource-group RG-VPN --allocation-method Dynamic --sku Basic
VPN Gateway Creation
CLI Command using the above resources to create the Basic SKU Gateway.
az network vnet-gateway create --name <Gateway Name> --public-ip-address <Public IP Name> --resource-group <RG Name> --vnet <VNet Name> --gateway-type <Type> --vpn-type <VPN Type> --sku <SKU> --no-wait
For available values check here
Example:
az network vnet-gateway create --name VNG-VPN --public-ip-address PIP-VPN --resource-group RG-VPN --vnet VN-VPN --gateway-type Vpn --vpn-type RouteBased --sku Basic --no-wait