Built-in HA by tier
| Tier | HA architecture | Typical failover |
|---|---|---|
| General Purpose | Compute is stateless; data and log on remote premium storage. A new compute node attaches the files. | Usually under a minute; cold cache afterwards |
| Business Critical | Always On availability group with 4 replicas on local SSD (1 primary + 3 secondaries), one readable | Seconds; warm replicas |
| Hyperscale | Compute nodes + page servers + log service; optional HA secondary replicas | Seconds with HA replicas; slower with 0 replicas |
Zone redundancy
Spreads replicas (or compute + storage) across availability zones, so a zone outage doesn't take the database down.
az sql db update -g rg-sql -s sql-prod-cin -n Sales --zone-redundant true
az sql db show -g rg-sql -s sql-prod-cin -n Sales --query "{tier:sku.tier, zr:zoneRedundant}"
- Supported for General Purpose (in many regions), Business Critical and Hyperscale (with HA replicas, set at creation in some cases).
- Turning it on is an online operation, but schedule it in a quiet window.
Make the app resilient to failovers
Even with HA, failovers and planned maintenance cause brief connection drops (errors 40613, 40197, 40501, 49918, 4060 and similar transient errors).
- Use a driver with connection resiliency (
ConnectRetryCount,ConnectRetryIntervalin ADO.NET). - Add retry with exponential backoff for transient errors around each operation, not just at connect.
- Keep transactions short; long transactions are rolled back on failover.
- Set
MultiSubnetFailover=Truein connection strings (helps redirection after failover with failover groups).
"Server=tcp:sql-prod-cin.database.windows.net,1433;Database=Sales;Authentication=Active Directory Managed Identity;Encrypt=True;Connect Timeout=30;ConnectRetryCount=3;ConnectRetryInterval=10;"
Maintenance window
Pick a maintenance window (for example weekday nights in your local time) so planned reconfigurations happen when traffic is low:
az sql db update -g rg-sql -s sql-prod-cin -n Sales --maint-config-id SQL_Centralindia_DB_1
(List available configurations with az maintenance public-configuration list.)
Read scale-out
Business Critical and Hyperscale offer readable secondaries. Route reporting with ApplicationIntent=ReadOnly to offload the primary.
Test
Trigger a user-initiated failover in a test environment and watch application errors:
az sql db failover -g rg-sql -s sql-test-cin -n Sales
Note
HA covers zone and node failures inside one region. A region outage needs geo-replication or failover groups, covered in the Azure SQL DR post.