0
0
Azurecloud~5 mins

DTU vs vCore pricing models in Azure - CLI Comparison

Choose your learning style9 modes available
Introduction
Choosing the right pricing model for Azure SQL Database helps you control costs and performance. DTU and vCore are two ways to pay for database resources, each with different benefits.
When you want a simple, fixed-price option that bundles compute, storage, and IO together.
When you need flexibility to scale compute and storage independently based on workload.
When you want to compare costs between Azure SQL and on-premises SQL Server licenses.
When you want to optimize costs for predictable workloads with fixed resource needs.
When you want to pay only for the compute and storage you actually use.
Commands
This command creates an Azure SQL Database using the DTU pricing model with the S3 tier, which bundles compute, storage, and IO resources.
Terminal
az sql db create --resource-group example-rg --server example-server --name example-db-dtu --service-objective S3
Expected OutputExpected
{ "databaseName": "example-db-dtu", "edition": "Standard", "requestedServiceObjectiveName": "S3", "status": "Online" }
--service-objective - Sets the DTU performance level (e.g., S3)
--resource-group - Specifies the Azure resource group
--server - Specifies the Azure SQL server name
This command creates an Azure SQL Database using the vCore pricing model with 4 vCores in the General Purpose tier, allowing independent scaling of compute and storage.
Terminal
az sql db create --resource-group example-rg --server example-server --name example-db-vcore --edition GeneralPurpose --family Gen5 --capacity 4
Expected OutputExpected
{ "databaseName": "example-db-vcore", "edition": "GeneralPurpose", "requestedServiceObjectiveName": "GP_Gen5_4", "status": "Online" }
--edition - Sets the service tier for vCore model
--family - Specifies the hardware generation (e.g., Gen5)
--capacity - Number of vCores to allocate
This command checks the details and status of the DTU-based database to confirm it is running with the expected performance level.
Terminal
az sql db show --resource-group example-rg --server example-server --name example-db-dtu
Expected OutputExpected
{ "databaseName": "example-db-dtu", "edition": "Standard", "requestedServiceObjectiveName": "S3", "status": "Online" }
This command checks the details and status of the vCore-based database to confirm it is running with the expected compute capacity.
Terminal
az sql db show --resource-group example-rg --server example-server --name example-db-vcore
Expected OutputExpected
{ "databaseName": "example-db-vcore", "edition": "GeneralPurpose", "requestedServiceObjectiveName": "GP_Gen5_4", "status": "Online" }
Key Concept

If you remember nothing else, remember: DTU bundles resources for simplicity, while vCore lets you scale compute and storage separately for flexibility and cost control.

Common Mistakes
Trying to specify vCore options like --family or --capacity when creating a DTU-based database.
DTU pricing model does not support independent compute or storage scaling flags.
Use --service-objective with DTU tiers like Basic, S1, S3 without vCore-specific flags.
Using the DTU model when you need to scale storage independently.
DTU bundles storage and compute, so you cannot scale them separately, leading to inefficient resource use.
Choose the vCore model to scale compute and storage independently.
Not checking the database status after creation.
You might assume the database is ready when it is still provisioning or failed.
Run az sql db show to verify the database is online and has the correct configuration.
Summary
Use az sql db create with --service-objective to create DTU-based Azure SQL Databases.
Use az sql db create with --edition, --family, and --capacity to create vCore-based Azure SQL Databases.
Check database status with az sql db show to confirm successful creation and configuration.