Database Choices in Azure
Deciding between a managed PaaS database and lifting your own SQL Server instance onto a VM changes how you handle backups, patching, and scaling. Both paths work, but the operational burden shifts dramatically.
Cost and Performance Factors
Azure SQL Database abstracts away the OS layer and handles automated backups, yet you pay per DTU or vCore and hit soft limits on connection pooling. A self-hosted instance on an Azure VM gives you full control over tempdb configuration and linked-server setups, at the cost of patching windows and storage management.
-- Example: querying Azure SQL Database for current DTU utilization.
-- This helps you decide whether to scale up or switch to a provisioned instance.
SELECT
name AS database_name,
CAST(avg_cpu_percent AS DECIMAL(5,2)) AS avg_cpu,
CAST(avg_data_io_percent AS DECIMAL(5,2)) AS avg_io
FROM sys.dm_db_resource_stats
WHERE interval_id = (SELECT MAX(interval_id) FROM sys.dm_db_resource_stats);
-- If avg_cpu consistently exceeds 80%, consider upgrading the service tier.
For most greenfield ASP.NET Core projects, starting with Azure SQL Database and migrating later is cheaper than maintaining a VM from day one. Just watch out for long-running transactions that can throttle your DTU ceiling.