azurerm_ mysql_ server cost estimation
The legacy MySQL 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_
As with the PostgreSQL Single Server, the key fact is retirement: Azure Database for MySQL Single Server has reached end of support, and Microsoft steers workloads to MySQL Flexible Server. Flexible Server 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 is the decision that matters.
The runtime levers (right-size vCores and storage) still apply, but the strategic move is migrating off the retired platform, where Flexible Server's burstable and stop/start options often cut a comparable workload's cost.
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_mysql_server" "db" {
name = "app-mysql"
location = azurerm_resource_group.main.location
resource_group_name = azurerm_resource_group.main.name
sku_name = "GP_Gen5_2"
storage_mb = 51200
version = "8.0"
administrator_login = "mysqladmin"
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_mysql_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 MySQL 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. 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 MySQL 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 MySQL Single Server retired?
Yes, Azure Database for MySQL Single Server has reached end of support, and Microsoft steers workloads to Flexible Server (cheaper, burstable tiers, stop/start, better HA). Existing Single Servers should migrate.
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_.