azurerm_ virtual_ network cost estimation
A virtual network is free. The address space, subnets, and the network itself cost nothing. The bill comes from the paid resources you run inside it and the traffic it carries.
An azurerm_
The cost of a VNet is the paid infrastructure attached to it and the traffic that crosses its boundaries. The usual drivers are VNet peering (billed per GB in both directions, and much more expensive across regions), NAT Gateway (an hourly charge plus per-GB processing), VPN and ExpressRoute gateways (a fixed hourly charge per gateway), private endpoints, and outbound data transfer to the internet or across regions. A VNet with private subnets almost always pairs with at least one NAT Gateway or gateway, so the free network quietly anchors a recurring bill.
The high-value VNet cost decisions are architectural: whether you peer across regions (expensive) or keep chatty workloads in one region, whether you route egress through a NAT Gateway versus a firewall, and how many gateways you provision. c3x prices the NAT Gateways, gateways, public IPs, and peering traffic attached to your network and treats the VNet, its address space, and subnets as the free scaffolding they are.
Terraform example
A minimal but realistic configuration that C3X can estimate.
resource "azurerm_resource_group" "main" {
name = "network-rg"
location = "eastus"
}
resource "azurerm_virtual_network" "main" {
name = "main-vnet"
resource_group_name = azurerm_resource_group.main.name
location = azurerm_resource_group.main.location
address_space = ["10.0.0.0/16"]
subnet {
name = "app"
address_prefixes = ["10.0.1.0/24"]
}
}Pricing dimensions
What you actually pay for when you provision azurerm_.
| Dimension | Unit | What's being charged |
|---|---|---|
| Virtual network and subnets | free | The VNet, its address space, subnets, and intra-VNet traffic have no charge. $0 |
| VNet peering traffic | per GB | Data sent between peered VNets is billed both ways, and cross-region peering costs several times more than same-region. ~$0.01/GB in and out for same-region peering |
| NAT Gateway or gateway (typical inside) | per hour + per GB | A NAT Gateway, VPN gateway, or ExpressRoute gateway is the most common paid attachment on a VNet with private egress. NAT Gateway: ~$0.045/hour + $0.045/GB processed |
| Outbound data transfer | per GB | Egress to the internet and cross-region traffic generated by resources in the VNet. |
Optimization tips
Common ways to reduce azurerm_ cost without changing the workload.
Keep chatty workloads in one region
Cross-region VNet peering is billed per GB each way at a much higher rate than same-region peering. Colocating services that talk frequently removes that transfer charge.
Share one NAT Gateway across subnets
~$32/month per gateway removedA single NAT Gateway can serve multiple subnets in a region. Consolidating outbound paths avoids paying the hourly charge for several gateways.
Use service endpoints instead of routing PaaS traffic out
Free service endpoints keep traffic to Azure Storage, SQL, and Key Vault on the Azure backbone, off the NAT Gateway and off metered egress.
FAQ
Does an Azure virtual network cost money?
No. The VNet, its address space, subnets, and traffic within the same VNet are all free. Cost comes from paid attachments like NAT Gateways, VPN and ExpressRoute gateways, peering traffic, and outbound data transfer.
What is usually the biggest cost tied to a VNet?
Gateways and cross-boundary traffic. A NAT Gateway or VPN gateway bills hourly, and VNet peering plus internet egress add per-GB charges that scale with usage, especially across regions.
Is VNet peering free?
The peering link has no fixed fee, but data that crosses it is billed per GB in both directions. Same-region peering is inexpensive; cross-region peering is several times more, so it is a real cost driver.
Related resources
More Azure resources
Further reading
- Azure VNet peering cost: the per-GB charge that bills both ways
VNet peering has no hourly fee but charges ~$0.01/GB each direction (more for global). It bills on both sides. Here's where the cost hides in hub-and-spoke and chatty services, and how to cut it.
- Azure Firewall Manager cost: policy management plus the firewalls
Firewall Manager centrally manages Azure Firewall policies and security across many networks; the meaningful cost is the Azure Firewalls themselves plus per-policy charges beyond the first. Here is the model.
- Azure Private Link cost: per endpoint hour plus data processed
Private Link bills per private endpoint per hour plus per GB of data processed, keeping traffic to Azure services on the backbone privately. It adds cost but can reduce egress and improve security. Here is the model and the tradeoff.
- Azure Firewall cost: the deployment fee is the surprise
Azure Firewall charges a fixed hourly deployment fee (around $1.25/hour, roughly $900/month) plus about $0.016 per GB processed. The always-on hourly fee, not data processing, is what shocks teams. Here is the breakdown and cheaper alternatives.
Estimate this resource in your own Terraform
Free, open source, no API key. C3X parses your Terraform and shows line-item cost for every resource, including azurerm_.