Share via

Replication Provider A2A entered invalid for the current set of parameters

Brian 0 Reputation points
2026-03-12T16:20:37.27+00:00

New-AzRecoveryServicesAsrProtectionContainerMapping : Operation failed. Replication Provider A2A entered invalid for the current set of parameters. At line:5 char:5 +     New-AzRecoveryServicesAsrProtectionContainerMapping -Name "MyMapp ... +     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~     + CategoryInfo          : CloseError: (:) [New-AzRecoveryS...ontainerMapping], Exception     + FullyQualifiedErrorId : Microsoft.Azure.Commands.RecoveryServices.SiteRecovery.NewAzureRmRecoveryServicesAsrProtectionContainerMappin

Azure Site Recovery
Azure Site Recovery

An Azure native disaster recovery service. Previously known as Microsoft Azure Hyper-V Recovery Manager.

{count} votes

1 answer

Sort by: Most helpful
  1. Marcin Policht 82,360 Reputation points MVP Volunteer Moderator
    2026-03-12T20:11:39.9766667+00:00

    That error typically means the parameters passed to New-AzRecoveryServicesAsrProtectionContainerMapping do not match the Azure-to-Azure (A2A) replication provider requirements. The cmdlet validates that the protection containers, fabrics, and replication policy are all compatible with A2A replication. If any of those objects come from a different provider type, the operation fails with the message that the A2A provider is invalid for the current parameters.

    A frequent cause is using a replication policy that was created for a different provider such as Hyper-V or VMware, or retrieving containers from fabrics that are not of type Azure. Another common issue is running the mapping command before setting the Recovery Services vault context, which causes objects to be resolved incorrectly.

    Ensure the vault context is set first.

    $vault = Get-AzRecoveryServicesVault -Name "MyVault"
    Set-AzRecoveryServicesAsrVaultContext -Vault $vault
    

    Retrieve the Azure fabrics and containers.

    $fabrics = Get-AzRecoveryServicesAsrFabric | Where-Object {$_.FabricType -eq "Azure"}
    
    $primaryFabric = $fabrics | Where-Object {$_.Location -eq "eastus"}
    $recoveryFabric = $fabrics | Where-Object {$_.Location -eq "westus"}
    
    $primaryContainer = Get-AzRecoveryServicesAsrProtectionContainer -Fabric $primaryFabric
    $recoveryContainer = Get-AzRecoveryServicesAsrProtectionContainer -Fabric $recoveryFabric
    

    Confirm the replication policy uses the A2A provider.

    $policy = Get-AzRecoveryServicesAsrReplicationPolicy | Where-Object {$_.ReplicationProvider -eq "A2A"}
    

    Then create the mapping.

    New-AzRecoveryServicesAsrProtectionContainerMapping `
    -Name "MyMapping" `
    -PrimaryProtectionContainer $primaryContainer `
    -RecoveryProtectionContainer $recoveryContainer `
    -Policy $policy
    

    If the error still occurs, inspect the objects to confirm the provider types.

    $policy.ReplicationProvider
    $primaryContainer.FabricFriendlyName
    $recoveryContainer.FabricFriendlyName
    

    If the above response helps answer your question, remember to "Accept Answer" so that others in the community facing similar issues can easily find the solution. Your contribution is highly appreciated.

    hth

    Marcin

    0 comments No comments

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.