Share via

Replication Provider A2A entered invalid for the current set of parameters

Brian 40 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.

0 comments No comments

Answer accepted by question author
  1. Siva shunmugam Nadessin 7,735 Reputation points Microsoft External Staff Moderator
    2026-03-13T02:12:08.8966667+00:00

    Hello Brian,

    Thank you for reaching out to the Microsoft Q&A forum.

    It looks like you’re hitting that “Replication Provider A2A entered invalid for the current set of parameters” error because the container-mapping cmdlet needs a valid fabric mapping and matching source/target containers for an A2A (Azure-to-Azure) scenario. Here’s what you can do:

    1. Set your vault context
         $vault = Get-AzRecoveryServicesVault –Name "MyVault"
         Set-AzRecoveryServicesVaultContext –Vault $vault
      
    2. Retrieve your source and target fabrics
         $primaryFabric  = Get-AzRecoveryServicesAsrFabric –Name "PrimaryAzureFabric"
         $recoveryFabric = Get-AzRecoveryServicesAsrFabric –Name "RecoveryAzureFabric"
      
    3. Create a fabric mapping between them
         $fabricMapping = New-AzRecoveryServicesAsrFabricMapping `
           –Name "PrimaryToRecovery_FabricMap" `
           –SourceRecoveryServicesAsrFabric  $primaryFabric `
           –TargetRecoveryServicesAsrFabric  $recoveryFabric `
           –AllowedOperations EnableProtection,Shutdown,PlannedFailover,UnplannedFailover,Reprotect
      
      Grab the protection containers (usually your RG’s)
         $srcContainer    = Get-AzRecoveryServicesAsrProtectionContainer `
                              –Fabric $primaryFabric  –Name "SourceRGContainer"
         $targetContainer = Get-AzRecoveryServicesAsrProtectionContainer `
                              –Fabric $recoveryFabric –Name "TargetRGContainer"
      
    4. Finally, create the container mapping
         New-AzRecoveryServicesAsrProtectionContainerMapping `
           –Name "RG-Primary-to-Secondary" `
           –SourceProtectionContainer   $srcContainer `
           –TargetProtectionContainer   $targetContainer `
           –RecoveryReplicationFabricMapping $fabricMapping
      

    Key things to verify if you still see the “invalid” error:

    • You actually have a fabric mapping in place (Get-AzRecoveryServicesAsrFabricMapping should list your mapping).
    • The source/target container names match exactly what Get-AzRecoveryServicesAsrProtectionContainer returns.
    • You’re not passing extra parameters (InstanceType, A2AReplicationDetails, etc.) to the cmdlet—just the objects above.

    If it still doesn’t work, could you share:

    • The exact names/objects you used for -SourceRecoveryServicesAsrFabric and -TargetRecoveryServicesAsrFabric?
    • The output of Get-AzRecoveryServicesAsrFabricMapping?
    • A screenshot or copy of Get-AzRecoveryServicesAsrProtectionContainer for both fabrics?

    Reference list:

    Hope that helps! Let me know the details above if it’s still acting up.

     


Answer accepted by question author
  1. Marcin Policht 85,065 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 additional answers

Sort by: Most helpful

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.