azurerm_mssql_managed_instance cost estimation
A fully managed SQL Server instance with near-100% engine compatibility. Priced per vCore-hour by service tier and hardware generation, plus included and overage storage.
An azurerm_mssql_managed_instance is the middle ground between a single Azure SQL Database and running SQL Server yourself on a VM. You get the full SQL Server surface (SQL Agent, cross-database queries, CLR, Service Broker) as a managed service, deployed into your own VNet. That managed-instance-in-a-VNet model is why it costs meaningfully more than a single database.
The dominant cost is compute, billed per vCore-hour. The rate depends on the service tier (General Purpose is the baseline; Business Critical adds local SSD and a built-in readable replica at roughly 2.7x the rate) and the hardware generation (Standard-series Gen5 is the common default). A managed instance has a minimum of 4 vCores, so even an idle instance has a real floor: 4 vCores of General Purpose Gen5 runs around $1,460/month before storage.
Storage is the second dimension. General Purpose includes 32 GB and then bills additional storage per GB-month; Business Critical includes storage with the compute. c3x reads the sku_name, vcores, and storage_size_in_gb from your Terraform and prices compute plus overage storage. Backup storage (point-in-time and long-term retention) is usage-based and modelled separately when you supply it.
Terraform example
A minimal but realistic configuration that C3X can estimate.
resource "azurerm_mssql_managed_instance" "core" {
name = "core-sqlmi"
resource_group_name = azurerm_resource_group.db.name
location = "eastus"
sku_name = "GP_Gen5"
vcores = 8
storage_size_in_gb = 256
administrator_login = "sqladmin"
administrator_login_password = var.sqlmi_password
subnet_id = azurerm_subnet.sqlmi.id
license_type = "BasePrice"
}Pricing dimensions
What you actually pay for when you provision azurerm_mssql_managed_instance.
| Dimension | Unit | What's being charged |
|---|---|---|
| vCores (compute) | per vCore-hour | Per-vCore rate for the chosen tier and hardware generation. Business Critical is roughly 2.7x General Purpose. Minimum 4 vCores. c3x assumes 730 hours/month. $0.50/vCore-hour for General Purpose Gen5 |
| Included storage | 32 GB included | General Purpose includes 32 GB at no extra charge; storage beyond that bills per GB-month. |
| Overage storage | per GB-month | Provisioned storage above the included 32 GB. c3x prices the difference between storage_size_in_gb and the included allowance. $0.115/GB-month |
| Backup storage | per GB-month | Point-in-time and long-term retention backups beyond the included allowance. Usage-based; define expected retention in c3x-usage.yml to model it. |
Sample C3X output
Example output from c3x estimate for the Terraform above:
azurerm_mssql_managed_instance.core
├─ Compute (GP_Gen5, 8 vCores) 5,840 vCore-hours $2,920.00
└─ Storage (beyond 32 GB included) 224 GB-month $25.76
OVERALL TOTAL $2,945.76Optimization tips
Common ways to reduce azurerm_mssql_managed_instance cost without changing the workload.
Apply Azure Hybrid Benefit if you own SQL Server licenses
30-40%Setting license_type to AHUB drops the rate to the base-compute price, removing the SQL license component. For organizations with existing Software Assurance, this is often a 30-40% reduction.
Stay on General Purpose unless you need the BC features
Up to 60%Business Critical costs ~2.7x and is only worth it if you need the local-SSD latency or the built-in readable secondary. Many workloads run fine on General Purpose with zone redundancy.
Buy a reserved capacity term for steady instances
~30%A 1-year reserved capacity commitment on the vCores typically saves ~30% over pay-as-you-go, 3-year more. Model with purchaseOption in c3x-usage.yml.
FAQ
How does c3x price an Azure SQL Managed Instance?
It reads sku_name (tier and hardware generation), vcores, and storage_size_in_gb from your Terraform, prices the compute per vCore-hour at 730 hours/month, and adds overage storage beyond the 32 GB included with General Purpose. Backup storage is usage-based and added only if you supply it.
Why is Managed Instance so much more expensive than a single Azure SQL Database?
Managed Instance has a 4-vCore minimum and runs a full SQL Server engine inside your VNet, so even a small instance starts around $1,460/month. A single azurerm_mssql_database can run on a much smaller vCore or DTU allocation, so it is cheaper for workloads that don't need instance-scoped features.
Does the estimate include the SQL Server license?
Yes. The default BasePrice license_type includes the SQL license in the vCore rate. If you set license_type to AHUB (Azure Hybrid Benefit), c3x prices the lower base-compute rate without the license component.
Is Business Critical priced differently?
Yes. Set sku_name to a BC_ tier and c3x applies the Business Critical rate, roughly 2.7x General Purpose, which reflects the local SSD storage and the included readable replica.
How is storage billed?
General Purpose includes 32 GB; c3x bills only the provisioned storage above that at the per-GB-month rate. Business Critical bundles storage into the compute price.
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_managed_instance.