azurerm_ postgresql_ server cost estimation
The legacy PostgreSQL Single Server, billed per vCore plus storage. A 2-vCore GP server with 50 GB is ~$70/month, but Single Server is retired, so migrate to Flexible Server.
An azurerm_
The headline isn't the price, it's that Single Server is retired. Microsoft has ended support for Azure Database for PostgreSQL Single Server, steering all workloads to Flexible Server, which is generally cheaper and more capable: burstable tiers for dev/test, stop/start to pause compute, better reserved pricing, and zone-redundant HA. For any existing Single Server, migration to Flexible Server is the decision that matters.
Within the runtime cost the usual levers apply, right-size vCores, right-size storage, but the strategic move is migrating off the retired platform, where Flexible Server's burstable and stop/start options can cut a comparable workload's cost substantially.
c3x prices the server from its vCores and storage, useful for comparing against the Flexible Server migration target.
Terraform example
A minimal but realistic configuration that C3X can estimate.
resource "azurerm_postgresql_server" "db" {
name = "app-postgres"
location = azurerm_resource_group.main.location
resource_group_name = azurerm_resource_group.main.name
sku_name = "GP_Gen5_2"
storage_mb = 51200
version = "11"
administrator_login = "pgadmin"
administrator_login_password = var.db_password
ssl_enforcement_enabled = true
}Pricing dimensions
What you actually pay for when you provision azurerm_.
| Dimension | Unit | What's being charged |
|---|---|---|
| vCores (General Purpose) | per vCore-hour | Per vCore-hour on the GP tier, billed continuously. $0.0438/vCore-hour → 2 vCores ≈ $63.95/month |
| Storage | per GB-month | Provisioned storage, billed per GB-month. $0.115/GB-month → 50 GB = $5.75/month |
Sample C3X output
A 2-vCore General Purpose Single Server with 50 GB, 24/7:
azurerm_postgresql_server.db
├─ vCores (GP Gen5, 2 vCore) 1460 vCore-hours $63.95
└─ Storage 50 GB-month $5.75
Monthly $69.70Optimization tips
Common ways to reduce azurerm_ cost without changing the workload.
Migrate to PostgreSQL Flexible Server
Access to burstable/stop-start savingsSingle Server is retired. Flexible Server is the successor, generally cheaper, with burstable tiers for dev/test, stop/start to pause compute, and better reserved pricing. Migrating off the retired platform is the key cost (and support) decision.
Right-size vCores
Difference between vCore countsCompute scales with vCores. Monitor CPU/memory and step down over-provisioned servers; on Flexible Server, the burstable tier suits low-traffic databases for far less.
Right-size storage
Per GB-month avoidedStorage bills per provisioned GB. Provision to actual data size with headroom rather than over-allocating.
FAQ
How is Azure PostgreSQL Single Server billed?
Per vCore-hour (~$0.0438 on General Purpose Gen5) plus storage (~$0.115/GB-month). A 2-vCore server with 50 GB is ~$70/month. Note that Single Server is retired, Flexible Server is the supported successor.
Isn't PostgreSQL Single Server retired?
Yes, Microsoft has ended support for Azure Database for PostgreSQL Single Server, steering workloads to Flexible Server (cheaper, burstable tiers, stop/start, better HA). Existing Single Servers should migrate; that's the decision beyond runtime cost.
How does c3x estimate the cost?
From vcores and storage_
Related resources
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_.