Azure SQL Database
Create a fully managed Azure SQL Database, configure service tiers (DTU vs. vCore), and take advantage of built-in high availability and automatic backups.
Azure SQL Database is a free Cloud & IT Cert Prep lesson on CoddyKit — lesson 1 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Cloud & IT Cert Prep learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.
What Is Azure SQL Database?
Azure SQL Database is a fully managed relational database service built on the Microsoft SQL Server engine. Unlike running SQL Server on a virtual machine, Azure SQL Database removes the overhead of patching, hardware management, and backup scheduling. Microsoft handles all infrastructure tasks while you focus entirely on your application and data.
Service Tiers: DTU vs vCore
Azure SQL Database offers two purchasing models. The DTU model bundles compute, memory, and I/O into a single unit called a Database Transaction Unit — simple but less flexible. The vCore model lets you choose CPU cores and memory independently, and supports Azure Hybrid Benefit for licence savings. For most new workloads, vCore is recommended.
# vCore model example using Azure CLI
az sql db create \
--resource-group myRG \
--server mysqlserver \
--name mydb \
--service-objective GP_Gen5_2 \
--edition GeneralPurposeService Tier Options
Within the vCore model, three service tiers target different workloads. General Purpose suits most OLTP applications with balanced compute and storage. Business Critical provides ultra-low latency and built-in read replicas using in-memory technology. Hyperscale supports databases up to 100 TB with rapid horizontal scale-out.
Creating a SQL Server and Database
An Azure SQL Database lives inside a logical SQL server — a management endpoint that hosts multiple databases and enforces firewall rules, Entra ID authentication, and auditing settings. You create the logical server first, then create one or more databases within it. Each database is billed and scaled independently.
# Create logical server
az sql server create \
--name mysqlserver \
--resource-group myRG \
--location eastus \
--admin-user sqladmin \
--admin-password 'P@ssw0rd123!'
# Create database inside that server
az sql db create \
--resource-group myRG \
--server mysqlserver \
--name mydb \
--tier GeneralPurposeFirewall Rules and Connectivity
By default, Azure SQL Database blocks all inbound connections. You must add server-level firewall rules to allow specific IP ranges, or enable the 'Allow Azure services' toggle to let other Azure resources connect. For production environments, use private endpoints inside a VNet to avoid exposing the database to the public internet entirely.
# Allow your local IP to connect
az sql server firewall-rule create \
--resource-group myRG \
--server mysqlserver \
--name AllowMyIP \
--start-ip-address 203.0.113.10 \
--end-ip-address 203.0.113.10Built-In High Availability
Azure SQL Database provides built-in high availability with no configuration required. In the General Purpose tier, data files are stored on Azure Premium Storage with automatic replication. In the Business Critical tier, an Always On availability group runs three to four replicas across availability zones for near-zero RPO. SLAs reach 99.99% uptime.
Automatic Backups and PITR
Azure SQL Database automatically takes full backups weekly, differential backups every 12 hours, and transaction log backups every 5-12 minutes. These backups enable Point-In-Time Restore (PITR), letting you recover your database to any second within the retention period — from 7 up to 35 days depending on your tier.
# Restore a database to a specific point in time
az sql db restore \
--dest-name mydb-restored \
--edition GeneralPurpose \
--name mydb \
--resource-group myRG \
--server mysqlserver \
--time '2026-06-15T10:00:00'Elastic Pools for Multi-Tenant Apps
An elastic pool groups multiple Azure SQL Databases together so they share a fixed pool of DTUs or vCores. This is ideal for SaaS applications with many tenant databases that have unpredictable or offsetting workload peaks. Databases in a pool draw from the shared resource budget as needed, reducing per-database cost compared to provisioning resources individually.
# Create an elastic pool
az sql elastic-pool create \
--resource-group myRG \
--server mysqlserver \
--name mypool \
--edition GeneralPurpose \
--family Gen5 \
--capacity 8Security: Encryption and Auditing
Azure SQL Database encrypts all data at rest using Transparent Data Encryption (TDE) by default, and data in transit is always protected by TLS. Advanced Threat Protection detects anomalous database activity such as SQL injection attempts and flags them as security alerts. Enabling Auditing writes query logs to a storage account or Log Analytics workspace for compliance evidence.
Scaling Up and Down
Azure SQL Database supports dynamic scaling with minimal downtime. You can change the service tier or the number of vCores through the Azure portal, CLI, or API, and the change takes effect within seconds to minutes. This elasticity lets you scale up before a marketing event and scale back down afterwards, paying only for what you use when on the serverless tier.
# Scale up to 4 vCores
az sql db update \
--resource-group myRG \
--server mysqlserver \
--name mydb \
--service-objective GP_Gen5_4Serverless Tier for Dev Workloads
The serverless compute tier within General Purpose automatically pauses the database after a configurable period of inactivity and resumes on the next connection. You are billed only for the seconds the database is active, making it highly cost-effective for development, testing, and intermittently used applications that don't need to be always-on.
# Create a serverless database
az sql db create \
--resource-group myRG \
--server mysqlserver \
--name mydb-dev \
--edition GeneralPurpose \
--family Gen5 \
--capacity 1 \
--compute-model Serverless \
--auto-pause-delay 60Quick Check
Test your understanding of Microsoft Azure Fundamentals (AZ-900) concepts from this lesson.
Lesson Recap
In this lesson you learned: Azure SQL Database is a fully managed PaaS relational engine, the vCore model provides granular sizing and Hybrid Benefit support, and built-in high availability, automatic backups, and TDE are included at every tier. Next up we explore Azure Cosmos DB, Microsoft's globally distributed NoSQL service.
Frequently asked questions
Is the “Azure SQL Database” lesson free?
Yes — the full text of “Azure SQL Database” is free to read here on the web, and the Cloud & IT Cert Prep course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Cloud & IT Cert Prep course, upgrade to CoddyKit PRO.
What will I learn in “Azure SQL Database”?
Create a fully managed Azure SQL Database, configure service tiers (DTU vs. vCore), and take advantage of built-in high availability and automatic backups. You practise Cloud & IT Cert Prep with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.
Do I need any experience to start Cloud & IT Cert Prep?
No prior experience is required. Cloud & IT Cert Prep on CoddyKit is structured for beginners through advanced learners; this is — lesson 1 of 4, so you can start here or from the beginning and move at your own pace.
How long does the “Azure SQL Database” lesson take?
Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.
Can I write and run code in this Cloud & IT Cert Prep lesson?
Yes. Every Cloud & IT Cert Prep lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.