When preparing Azure virtual machines to fail over to a secondary region, you must define the target resources that will receive the replicated workload. These target resources include the target subscription, resource group, and virtual network. While Azure Site Recovery can automatically create these resources with an "asr" suffix, experienced administrators often manually customize these settings so the recovery environment matches the production setup exactly.
Network connectivity and IP addressing require careful planning during failover preparation. You can retain static IP addresses if the target subnet has the same address space available, or you can allow Azure to assign dynamic IP addresses by default. Network Security Groups in the target region must allow outbound replication traffic on port 443, and you can use Service Tags like Storage.region-name to simplify security rule creation. IP address mapping should be planned to avoid overlapping address spaces between source and target, and port 20004 must be manually opened when multi-VM consistency is required for Linux groups.
Load balancers and Azure Traffic Manager become essential when directing user traffic after a failover occurs. Azure Site Recovery does not automatically create VNet gateways or Load Balancers in the target region, so these components must be provisioned in advance. Recovery Plans combined with Azure Automation scripts can automate the connection of these components during the recovery process. Internal Load Balancers provide high availability for internal application tiers, while Azure Traffic Manager facilitates efficient network switchovers between different Azure regions. Public IP addresses must be associated with the recovered VMs to allow external access.
Compute sizing ensures that recovered workloads have sufficient resources to run properly in the target region. Azure Site Recovery typically selects a target VM size that matches or closely approximates the source VM based on available hardware. Availability Sets or Availability Zones must be configured in the target region to maintain high availability and protect against hardware failures within the secondary data center.
Specialized workloads such as SQL Server and Active Directory require additional recovery strategies. Azure Site Recovery integrates with SQL Always On availability groups to manage database failover with minimal data loss. It is a best practice to fail over Active Directory and DNS servers first so that other application tiers can authenticate and resolve names properly when they start up in the new region. FSMO roles may need to be seized if the primary domain controller is unavailable. App-consistent snapshots capture data in memory to ensure database integrity, and Recovery Plans allow you to sequence the startup of different application tiers.
Azure Site Recovery is a service that ensures business continuity and disaster recovery for Azure resources, including virtual machines and applications. It replicates workloads between Azure regions, on-premises virtual machines, and physical servers to Azure, enabling recovery when outages occur.
The first step in implementation is creating a Recovery Services vault, which serves as the central management point for orchestrating replication. You enable the managed identity of the vault through the Identity setting, and once registered with Microsoft Entra ID, you assign specific roles to the vault for storage accounts. For standard Resource Manager storage accounts, you need Contributor and Storage Blob Data Contributor roles. Premium Resource Manager storage accounts require Contributor and Storage Blob Data Owner roles, while classic storage accounts need Classic Storage Account Contributor and Classic Storage Account Key Operator Service Role.
Replication policies define how data is replicated and retained, including settings for recovery point retention history and app-consistent snapshot frequency. By default, Azure Site Recovery creates a new replication policy with a 24-hour recovery point retention and a 4-hour app-consistent snapshot frequency. These settings determine how much data you might lose during a disaster and how far back you can recover.
Enabling replication for Azure VMs involves selecting the source region, subscription, and resource group where the VMs are located, then choosing which VMs to replicate. You configure the target location, failover virtual network, and storage configuration before reviewing and enabling replication. Azure Site Recovery ensures data integrity through secure HTTPS connections and checksums that prevent tampering and ensure consistency during data transfer. All communication between microservices in Azure Site Recovery uses TLS 1.2 protocol.
You can automate Site Recovery workflows using the REST API, PowerShell, or the Azure SDK. PowerShell is particularly useful for replicating Hyper-V virtual machines and VMware virtual machines to Azure.
Execute and Orchestrate Disaster Recovery Operations
Azure Site Recovery helps organizations maintain business continuity by keeping applications running during outages. It works by replicating workloads from a primary site to a secondary location, such as another Azure region. When the main site fails, you switch to the secondary site to keep your business moving, ensuring data remains safe and services stay online even during a major disaster.
Recovery Plans organize how multiple virtual machines fail over together for complex applications. These plans automate the order of operations, ensuring that databases start before web servers to maintain application consistency. You can add custom steps to handle specific needs, including running Azure Automation runbooks for complex networking tasks, using custom scripts to update database connection strings or web rules, and inserting manual actions for steps requiring human verification.
There are three main types of failovers for switching to your backup site. A Test Failover is a disaster recovery drill that lets you check your strategy without losing data or stopping live services. Planned Failovers are used for scheduled maintenance to ensure zero data loss by shutting down the source first. Unplanned Failovers respond to sudden disasters and aim for the smallest amount of data loss possible.
When triggering a failover, you must choose a Recovery Point, which is a saved version of your data from a specific time. You can select the Latest Processed point for the fastest recovery or an App-Consistent point, which uses the Volume Shadow Copy Service to ensure database integrity. Choosing the right point helps you balance your Recovery Time Objective, which is how long you can be offline, against your Recovery Point Objective, which is how much data you can afford to lose.
After a failover is successful and verified, you must Commit the operation to finalize the move to the secondary site. Once the primary site is healthy again, you perform Reprotection to start sending data back from Azure to the original location. Finally, a Failback returns your workloads to their home site and resumes normal operations. This cycle ensures your environment is always protected regardless of where the live workload is currently running.