Is Azure Site Recovery Protection Container Mapping Supported Across Subscriptions via Terraform?
Hello,
I am attempting to configure Azure Site Recovery (ASR) replication between two Recovery Services Vaults located in different Azure subscriptions. My setup uses Terraform, and I have created the source and target Recovery Services vaults, fabrics, and protection containers as required.
Scenario:
- Source (Primary): Vault, fabric, and protection container in Subscription A.
- Target (DR): Vault, fabric, and protection container in Subscription B.
- Both vaults are in different subscriptions and different resource groups.
I am now trying to create a azurerm_site_recovery_protection_container_mapping from the primary vault to the DR vault/container. My Terraform code is similar to:
resource "azurerm_site_recovery_protection_container_mapping" "container_mapping" { provider = azurerm.primary name = "mapping" resource_group_name = var.primary_rg_name recovery_vault_name = var.primary_vault_name recovery_fabric_name = azurerm_site_recovery_fabric.primary_fabric.name recovery_source_protection_container_name = azurerm_site_recovery_protection_container.primary_container.name recovery_target_protection_container_id = <full resource ID of DR protection container in DR subscription> recovery_replication_policy_id = azurerm_site_recovery_replication_policy.vm_policy.id }
Error Encountered:
When applying this configuration, I consistently receive the following error:
Error: creating site recovery protection container mapping primary-to-DR-mapping (vault <primary_vault_name>): performing Create: unexpected status 404 (404 Not Found) with error: NotFound: Fabric with name <DR fabric name> could not be located.
In my terraform plan I can see it's getting creating but in apply it's throwing the above error!
Questions:
- Is it supported to configure ASR Protection Container Mappings across different subscriptions, where the source Recovery Services Vault/Fabric is in Subscription A and the target in Subscription B, using ARM templates or Terraform?
- Does the Site Recovery API inherently scope fabric/container discovery to the local subscription/vault context (making cross-subscription mappings unsupported by design)?
- Are there any known workarounds or roadmap items for enabling cross-subscription ASR protection container mappings, either through IaC or via the Azure Portal?
References:
I have reviewed Microsoft’s official ASR documentation as well as community posts and GitHub issues indicating this may be an unsupportable scenario, but I have not found a clear, official Microsoft statement confirming this limitation. For client documentation, I need direct confirmation from Microsoft.
If helpful, I can provide my full Terraform script