← Back to Portfolio

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

Primary regionProtected Azure VMs
Recovery Services VaultPolicies & orchestration
Recovery regionVM disks, NICs & private endpoints
1. Replicate and mapMaintain VM recovery points and source-to-target resource mappings.
2. Fail overRecover VMs and network resources; retain DNS names with recovery-region resolution.
3. Fail backAutomate the return to the primary region after validation.

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

Azure Azure Recovery Services Vault Terraform Infrastructure as Code Azure Site Recovery Azure Monitor RBAC Disaster Recovery PowerShell Azure SQL Database Private Endpoints DNS Azure REST API

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 Project

Rancher 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 Project

Datadog Monitoring at Marsh

Configured Datadog monitoring, dashboards, APM, and Database Monitoring for production applications at Marsh.

View Project