DR for PaaS Services
Design disaster recovery for Azure SQL Database using geo-replication and auto-failover groups, and compare this with VM-level replication for stateful workloads.
DR for PaaS Services is a free Cloud & IT Cert Prep lesson on CoddyKit — lesson 4 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.
DR for PaaS vs. IaaS
Disaster recovery for IaaS services (VMs) typically involves Azure Site Recovery to replicate the entire OS and data disks to a secondary region. PaaS services have different DR models because the underlying infrastructure is managed by Microsoft. For PaaS, DR is usually configured at the data layer — replicating the data to a secondary region while the platform itself spins up automatically.
Azure SQL Database: Built-In Redundancy
Azure SQL Database provides built-in high availability at the zone level within a single region. For cross-region DR, it offers two key capabilities: active geo-replication (readable secondary databases in up to four other regions) and auto-failover groups (automated failover with a single listener endpoint). These are configured at the database or server level without needing Azure Site Recovery.
# Create a geo-replication link:
az sql db replica create \
--resource-group myRG \
--server primarySqlServer \
--name myDatabase \
--partner-server secondarySqlServer \
--partner-resource-group secondaryRGAuto-Failover Groups
Auto-failover groups add automation and a single connection endpoint on top of geo-replication. You configure a group on the primary server, add the secondary server, and define a grace period — the time Azure waits for the primary to recover before triggering automatic failover. Applications connect to the listener endpoint (e.g., mygroup.database.windows.net) and are automatically redirected after failover without changing connection strings.
# Create an auto-failover group:
az sql failover-group create \
--resource-group myRG \
--server primarySqlServer \
--name myFailoverGroup \
--partner-server secondarySqlServer \
--partner-resource-group secondaryRG \
--failover-policy Automatic \
--grace-period 60RPO for Azure SQL with Geo-Replication
Azure SQL Database geo-replication is asynchronous — transactions are committed on the primary and then replicated to the secondary. This means there is a small replication lag, typically less than 5 seconds under normal conditions. The RPO for SQL geo-replication is therefore approximately 5 seconds in most scenarios, making it suitable for Tier 1 and Tier 2 workloads that require very low data loss.
Point-in-Time Restore for SQL
All Azure SQL Database tiers include automated backups: full backups weekly, differential backups every 12 hours, and transaction log backups every 5-12 minutes. This enables Point-in-Time Restore (PITR) — restoring the database to any second within the retention period (7-35 days for Standard/General Purpose, up to 35 days for Business Critical). PITR is useful for recovering from accidental data deletion or corruption.
# Restore a database to a specific point in time:
az sql db restore \
--resource-group myRG \
--server mySqlServer \
--name myDatabase-restored \
--source-database-name myDatabase \
--time '2026-06-20T14:30:00Z'Cosmos DB: Multi-Region Writes for DR
Azure Cosmos DB with multi-region writes provides near-zero RPO for global applications. All configured regions can accept write operations simultaneously, and Cosmos DB synchronises the data automatically using its proprietary replication protocol. If a region fails, traffic is automatically routed to the remaining healthy regions with no manual failover required — achieving RTO and RPO close to zero.
# Add a secondary region to Cosmos DB:
az cosmosdb update \
--resource-group myRG \
--name myCosmosAccount \
--locations regionName=eastus failoverPriority=0 isZoneRedundant=true \
regionName=westus failoverPriority=1 isZoneRedundant=trueAzure App Service DR Considerations
Azure App Service itself is stateless (application code is deployed from source control or a ZIP file). For DR, the focus is on the data layer (database and blob storage). App Service can be redeployed to a secondary region quickly via CI/CD pipeline. However, you should ensure your custom domain, TLS certificates, and app settings are replicated or scripted so they can be recreated in the secondary region rapidly.
# Export App Service configuration (app settings + connection strings):
az webapp config appsettings list \
--name myWebApp \
--resource-group myRG \
--output json > appsettings-backup.json
# Apply to secondary region App Service:
az webapp config appsettings set \
--name myWebApp-secondary \
--resource-group secondaryRG \
--settings @appsettings-backup.jsonAzure Storage: GRS and RA-GRS
Azure Blob Storage with Geo-Redundant Storage (GRS) automatically replicates data to a secondary region hundreds of miles away. Data is replicated asynchronously (RPO typically under 15 minutes). Read-Access GRS (RA-GRS) allows reading from the secondary endpoint even before failover is triggered, which is useful for analytics and reporting workloads during a primary region outage.
# Create a storage account with RA-GRS:
az storage account create \
--resource-group myRG \
--name mystorageaccount \
--sku Standard_RAGRS \
--kind StorageV2
# Secondary endpoint: mystorageaccount-secondary.blob.core.windows.netAzure Functions and Logic Apps DR
Azure Functions are stateless by design, making them easy to redeploy. For DR, deploy the same function app to a secondary region and use Traffic Manager to route HTTP triggers between regions. For non-HTTP triggers (Service Bus, Event Grid), configure the message source to fan out to both regions, or have the secondary region poll the same source. Function state in Durable Functions is stored in Azure Storage — ensure that storage uses GRS.
Choosing Between Active Geo-Replication and Auto-Failover Groups
Use active geo-replication when you need fine-grained control — for example, directing read traffic to a secondary for performance, or managing multiple secondaries in different regions independently. Use auto-failover groups when you want simplicity: a single listener endpoint, automatic failover on a timer, and built-in orchestration of the failover process without manual intervention.
Comparing PaaS and VM DR Costs
PaaS DR is often cheaper than VM-based DR for several reasons. SQL Database geo-replication charges only the secondary's storage and compute; you are not paying for a full VM OS license. Azure Cosmos DB charges for the provisioned RUs in each region. Azure Storage GRS adds approximately 2x the storage cost. In contrast, ASR-replicated VMs require full compute, storage, and licensing costs in the secondary region.
Quick Check
Test your understanding of Microsoft Azure Fundamentals (AZ-900) concepts from this lesson.
Lesson Recap
In this lesson you learned: PaaS DR focuses on the data layer rather than VM replication; Azure SQL auto-failover groups provide a single listener endpoint with automated failover; and Cosmos DB multi-region writes deliver near-zero RTO and RPO for global applications. Next up we explore Azure compliance frameworks and the shared responsibility model.
Frequently asked questions
Is the “DR for PaaS Services” lesson free?
Yes — the full text of “DR for PaaS Services” 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 “DR for PaaS Services”?
Design disaster recovery for Azure SQL Database using geo-replication and auto-failover groups, and compare this with VM-level replication for stateful workloads. 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 4 of 4, so you can start here or from the beginning and move at your own pace.
How long does the “DR for PaaS Services” 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.