Azure Recovery Services Vaults with Terraform
September 2026 - Present
Fully automated Azure region-to-region DR: VM replication, network and DNS recovery, and scripted SQL geo-restore.
The objective
Fully automate Azure region-to-region disaster recovery for virtual machines and SQL databases, targeting a low recovery time objective (RTO) while retaining the same application-facing DNS names.
My contribution
Designed the recovery foundation with Terraform and automated failover and failback workflows with PowerShell, combining Azure Site Recovery VM replication with separate SQL geo-restore scripts.
Engineering approach
- Defined reusable modules for Recovery Services Vaults, backup policies, replication settings, protected workloads, and RBAC.
- Automated Azure Site Recovery VM replication and source-to-target resource mappings, coordinating recovery-region copies of VM disks and the required network interfaces (NICs) and private endpoints.
- Mapped recovered resources to the target-region network and retained the same DNS names, updating resolution to the recovery endpoints rather than requiring application connection-name changes.
- Automated SQL database recovery and return-to-primary workflows with SQL geo-restore scripts. This database workflow is separate from Recovery Services Vault VM replication and is restore-based, not a SQL failover-group replica promotion.
- Built PowerShell (.ps1) automation using the AzRestWithbodyFile helper: assemble request properties as a hashtable, serialize the payload with ConvertTo-Json, and supply the JSON body file for Azure REST requests.
- Used AzRestWithbodyFile for scripted recovery operations because the organization follows a no-ClickOps model: infrastructure is managed through Terraform IaC rather than manual Azure portal changes. Terraform defines the infrastructure, while PowerShell issues the operational recovery requests through Azure REST APIs.
- Orchestrated failover and failback across compute, networking, DNS, and database recovery to reduce manual intervention.
Validation and operational safeguards
- Monitored replication health, backup status, and recovery readiness with alerting.
- Validated the design through scheduled recovery drills.
The outcome
Fully automated region-to-region DR workflows with consistent DNS names and less manual recovery work, designed for a low VM recovery time. SQL recovery time and recovery point depend on geo-backup availability and restore duration; no measured RTO or RPO is claimed.
Recovery architecture
Separate SQL recovery path: PowerShell geo-restore scripts automate database recovery and return-to-primary workflows. SQL databases are not replicated through the Recovery Services Vault.
Technologies Used
Related Projects
Magento Web Application Deployment on Azure
Magento on Red Hat Linux with Redis caching, Jenkins blue/green releases, cookie-based routing, and automated fallback.
View ProjectRancher Kubernetes Cluster on Red Hat Linux
End-to-end production Kubernetes and Docker on Red Hat Linux, with Rancher management and NGINX routing at InComm Payments.
View ProjectDatadog Monitoring at Marsh
Configured Datadog monitoring, dashboards, APM, and Database Monitoring for production applications at Marsh.
View Project