Deployment Options
| Option | Description | Best For |
|---|---|---|
| Single Database | One database with its own guaranteed resources | Isolated databases with predictable workloads |
| Elastic Pool | Multiple databases sharing a pool of resources | Multi-tenant SaaS apps with variable usage |
| Serverless | Auto-scales compute, pauses when idle | Dev/test, sporadic workloads |
Purchasing Models
DTU Model (Database Transaction Units)
A bundled measure of compute, memory, and I/O. Simpler but less transparent. Three tiers: Basic, Standard, Premium.
vCore Model (Recommended)
Choose specific number of vCPUs, memory, and storage independently. More transparent pricing. Supports Azure Hybrid Benefit. Five tiers: General Purpose, Business Critical, Hyperscale, Serverless, and Free offer.
Service Tiers (vCore)
| Tier | Storage | IOPS | HA | Best For |
|---|---|---|---|---|
| General Purpose | Up to 4 TB | Up to 7,000 | 99.99% | Most production workloads |
| Business Critical | Up to 4 TB | Up to 200,000 | 99.99% | High IOPS, in-memory OLTP, readable secondary |
| Hyperscale | Up to 100 TB | High | 99.99% | Very large databases, variable workloads |
Elastic Pools
Elastic Pools allow multiple databases to share a pool of compute and storage resources. Instead of provisioning maximum resources for each database (that each uses at different times), they share the pool — reducing overall cost.
Serverless Tier
Serverless Azure SQL Database auto-scales compute between a configured min and max, and automatically pauses the database after a period of inactivity — billing stops for compute while paused (storage charges continue). Perfect for development, testing, or applications with infrequent usage.
- Auto-pause delay: 1 hour minimum, up to 7 days
- First query after pause has a "cold start" delay (~30 seconds)
- Not suitable for workloads requiring 24/7 availability
Active Geo-Replication
Active Geo-Replication creates up to 4 readable secondary databases in different regions. Secondaries are continuously synchronised (asynchronously). For disaster recovery — if the primary region fails, you can manually failover to a secondary. Secondaries can also handle read workloads to offload the primary.
Auto-Failover Groups
Auto-Failover Groups build on geo-replication and add automatic failover — if the primary becomes unavailable, Azure automatically fails over to the secondary. A single connection string is provided that always points to the current primary — your application doesn't need to change anything.
Automated Backups and PITR
Azure SQL Database automatically takes:
- Full backups — Weekly
- Differential backups — Every 12 hours
- Transaction log backups — Every 5–10 minutes
Point-in-time restore (PITR) — Restore to any point within the retention period. Default retention: 7 days. Configurable: 1–35 days.
Security Features
- Transparent Data Encryption (TDE) — Encrypts data at rest automatically (enabled by default)
- Always Encrypted — Column-level encryption; data is encrypted even from the database engine's perspective
- Row-Level Security (RLS) — Filter rows based on user identity
- Dynamic Data Masking — Mask sensitive data for non-privileged users (e.g., show only last 4 digits of phone numbers)
- Azure AD Authentication — Authenticate with Azure AD identities instead of SQL logins
- Advanced Threat Protection — Detect unusual access patterns (SQL injection attempts, anomalous access)
- Firewall Rules — Control which IPs can connect; Private Endpoint for no public access
Connecting to Azure SQL Database
Azure SQL Database uses port 1433. Connection string format:
Server=tcp:myserver.database.windows.net,1433;
Initial Catalog=mydatabase;
Persist Security Info=False;
User ID=myuser;
Password=mypassword;
Encrypt=True;
TrustServerCertificate=False;
Creating via CLI
# Create a logical SQL server
az sql server create \
--name mydbserver-2026 \
--resource-group myRG \
--location centralindia \
--admin-user sqladmin \
--admin-password "SecureP@ssword123!"
# Create a database (General Purpose, 2 vCores)
az sql db create \
--resource-group myRG \
--server mydbserver-2026 \
--name myDatabase \
--edition GeneralPurpose \
--compute-model Provisioned \
--family Gen5 \
--capacity 2
# Allow Azure services to connect (optional)
az sql server firewall-rule create \
--resource-group myRG \
--server mydbserver-2026 \
--name AllowAzureServices \
--start-ip-address 0.0.0.0 \
--end-ip-address 0.0.0.0