azurerm_mssql_server cost estimation
The logical SQL server that hosts Azure SQL databases and elastic pools. The server is free. Cost lives on the databases and pools it contains: DTU or vCore compute, storage, and backup.
The azurerm_mssql_server resource creates a logical SQL server, which is an administrative and networking container, not a running database engine. It holds the admin login, firewall rules, private endpoints, Entra ID admin, and TLS settings, and it gives your databases their <server>.database.windows.net address. Creating one costs nothing. Azure only starts billing when you place an azurerm_mssql_database or azurerm_mssql_elasticpool on it.
Database pricing follows one of two models. The DTU model bundles compute, memory, and IO into a single blended unit: Basic is about $5/month (5 DTU, 2 GB), Standard S0 about $15/month (10 DTU), and S3 about $150/month (100 DTU). The vCore model separates compute from storage and is where serious workloads live: General Purpose Gen5 provisioned runs roughly $185/month per 2 vCore of compute before storage, and Business Critical costs several times that for local-SSD IO and readable replicas. Serverless vCore bills per vCore-second and auto-pauses, which is ideal for spiky or dev databases.
Storage and backup are separate line items that ride on the databases, not the server. vCore data storage is about $0.115/GB-month. Point-in-time-restore backup storage is free up to 100% of your provisioned data size, then charged at roughly $0.10 to $0.20/GB-month depending on redundancy. Long-term retention backups are billed separately and can quietly grow into a large recurring cost if you keep weekly or monthly backups for years.
The cost-adjacent gotcha is that the free server tempts sprawl. Because the container is free, teams spin up many logical servers, then place one small database on each, losing the ability to share an elastic pool. Elastic pools let many databases share a single pool of DTUs or vCores, which is dramatically cheaper than provisioning each database at its own peak. Consolidating databases onto one server so they can share a pool is often the single biggest Azure SQL saving.
c3x flags azurerm_mssql_server as free and attributes compute, storage, and backup cost to the databases and elastic pools attached to it.
Terraform example
A minimal but realistic configuration that C3X can estimate.
resource "azurerm_mssql_server" "main" {
name = "app-sql-server"
resource_group_name = azurerm_resource_group.main.name
location = "eastus"
version = "12.0"
administrator_login = "sqladmin"
administrator_login_password = var.sql_admin_password
minimum_tls_version = "1.2"
azuread_administrator {
login_username = "sql-admins"
object_id = var.aad_admin_object_id
}
}
resource "azurerm_mssql_database" "app" {
name = "appdb"
server_id = azurerm_mssql_server.main.id
sku_name = "GP_S_Gen5_2"
min_capacity = 0.5
max_size_gb = 32
auto_pause_delay_in_minutes = 60
}Pricing dimensions
What you actually pay for when you provision azurerm_mssql_server.
| Dimension | Unit | What's being charged |
|---|---|---|
| Logical SQL server | free | The server container, its firewall rules, and admin settings carry no per-resource charge. $0 (free) |
| DTU database (Basic) | per month | Entry-level bundled compute, memory, and IO. Fine for very small or intermittent databases. about $5/month (5 DTU) |
| DTU database (Standard S3) | per month | Mid-tier DTU database with 100 DTU of blended capacity. about $150/month (100 DTU) |
| vCore compute (General Purpose) | per month | Provisioned General Purpose Gen5 compute, before storage. Serverless bills per vCore-second instead. about $185/month per 2 vCore |
| Data storage | per GB-month | Allocated database storage on the vCore model. about $0.115/GB-month |
| Backup storage (beyond free) | per GB-month | Point-in-time-restore storage beyond 100% of provisioned size, plus any long-term retention backups. $0.10 to $0.20/GB-month |
Optimization tips
Common ways to reduce azurerm_mssql_server cost without changing the workload.
Consolidate databases so they can share an elastic pool
30 to 70% on a fleet of small databasesBecause the logical server is free, teams create one server per database and cannot pool. Put multiple databases on one server and one elastic pool so they share DTUs or vCores instead of each paying for its own peak capacity.
Use serverless with auto-pause for dev and spiky databases
Up to 80% on intermittent databasesServerless vCore bills per second and pauses after an idle window, so a development database used a few hours a day costs a fraction of a provisioned one. Set auto_pause_delay_in_minutes appropriately.
Prune long-term retention backups
Weekly and monthly LTR backups accumulate for years and are billed separately from PITR. Set a retention policy that matches your actual compliance requirement rather than the default maximum.
Right-size before scaling up
Check actual DTU or vCore utilization before moving up a tier. Many databases sit under 20% utilization, meaning a lower tier or serverless would serve the same load for far less.
FAQ
Does the Azure SQL logical server cost anything on its own?
No. The logical server is a free container for databases, elastic pools, firewall rules, and admin identity. You are billed only for the databases and elastic pools you place on it.
What is the cheapest way to run a small Azure SQL database?
Either the Basic DTU tier at about $5/month, or a serverless vCore database with auto-pause if the workload is intermittent. Serverless can drop to near zero compute cost while paused, though you still pay for storage.
Why is an elastic pool cheaper than separate databases?
An elastic pool provisions one shared block of DTUs or vCores that all databases in it draw from. Since databases rarely peak at the same moment, the pool can be sized well below the sum of each database's individual peak, so you buy less total capacity.
How is backup storage billed for Azure SQL?
Point-in-time-restore backup storage is free up to 100% of your provisioned data size, then roughly $0.10 to $0.20/GB-month depending on redundancy. Long-term retention backups are a separate charge and can grow large if kept for years.
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_mssql_server.