Is Azure Site Recovery Protection Container Mapping Supported Across Subscriptions via Terraform?

Majhi, Sarthak 0 Reputation points
2025-10-16T14:46:25.29+00:00

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:

  1. 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?
  2. Does the Site Recovery API inherently scope fabric/container discovery to the local subscription/vault context (making cross-subscription mappings unsupported by design)?
  3. 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

Azure Site Recovery
Azure Site Recovery
An Azure native disaster recovery service. Previously known as Microsoft Azure Hyper-V Recovery Manager.
0 comments No comments
{count} votes

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.