What ADF gives you
ADF's metadata is stored in its region. Microsoft does not offer customer-controlled failover of a data factory to another region, so you keep a deployable copy.
1. Git is the source of truth
- Development factory connected to Azure Repos or GitHub.
- Publishing generates ARM templates (or use the
@microsoft/azure-data-factory-utilitiesnpm package in CI). - One release pipeline deploys the same template to
adf-prod-cin(primary) andadf-prod-sin(DR) with different parameter files.
- task: AzureResourceManagerTemplateDeployment@3
inputs:
resourceGroupName: rg-data-dr
location: South India
csmFile: ARMTemplateForFactory.json
csmParametersFile: params/dr.json
overrideParameters: -factoryName adf-prod-sin
2. Parameterise what differs
| Item | Primary | DR |
|---|---|---|
| Key Vault URL | kv-data-cin | kv-data-sin |
| Storage / lake endpoints | primary account | GRS secondary, or a DR account |
| SQL endpoints | the failover group listener (same name for both) | same listener |
| Integration runtime | shir-cin | shir-sin |
Use a failover group listener or DNS names that move in DR, so most linked services don't change.
3. Triggers off in DR
Deploy the DR factory with triggers stopped (a CI step that stops triggers after deployment). Otherwise both factories run the same loads.
Get-AzDataFactoryV2Trigger -ResourceGroupName rg-data-dr -DataFactoryName adf-prod-sin |
ForEach-Object { Stop-AzDataFactoryV2Trigger -ResourceGroupName rg-data-dr -DataFactoryName adf-prod-sin -Name $_.Name -Force }
4. Integration runtimes
- Azure IR: auto-resolve or region-specific IRs. Check that the DR region has them.
- Self-hosted IR: install nodes registered to the DR factory in the DR site (see the SHIR HA post), or share one SHIR from a third factory.
- Managed VNet / private endpoints: recreate them in DR, and approve them on the target resources ahead of time.
5. Failover runbook
- Confirm the primary region issue, and stop triggers in the primary if it's reachable.
- Fail over dependent data stores (SQL failover group, storage account failover) as needed.
- Find the last successful watermark for incremental loads (from a control table in the database, not from ADF run history).
- Start triggers in the DR factory, or run catch-up pipelines manually.
- Monitor the first runs. Check SHIR nodes are online and private endpoints are approved.
6. Failback
Stop DR triggers, fail data stores back, then start primary triggers with the current watermarks.
Tip
Keep incremental-load watermarks in a database table that fails over with your data, not in pipeline variables or run history. Then DR runs resume from the right point automatically.