https://learn.microsoft.com/en-us/powershell/module/az.recoveryservices/update-azrecoveryservicesasrprotectiondirection?view=azps-12.1.0&viewFallbackFrom=azps-6.3.0[Doc]: #25530
Labels
customer-reported
Doc - Reference
Recovery Services Site-Recovery
Service Attention
This issue is responsible by Azure service team.
Type of issue
Code doesn't work
Feedback
I've created a simple runbook in Azure Automation to kick off a failover in site recovery referencing a recovery plan. Failover works fine, the issue comes to when I need to "failback". This starts with a re-protect to re-replicate traffic from the backup region back to the source region. In the Azure GUI, this is performed via the "Re-Protect" button in the Recovery Plan. In PowerShell, this re-protect should be performed with the cmdlet:
Update-AzRecoveryServicesAsrProtectionDirection
Following this documentation:
https://docs.microsoft.com/en-us/powershell/module/az.recoveryservices/update-azrecoveryservicesasrprotectiondirection?view=azps-6.3.0
Steps to reproduce
The following code is being used to attempt to initiate a re-protection action, this is done post failover from primary region to backup region:
$vault = Get-AzRecoveryServicesVault -Name $RecoveryVaultName -ResourceGroupName $RecoveryVaultRG
Set-AzRecoveryServicesAsrVaultContext -Vault $vault
$RP = Get-AzRecoveryServicesAsrRecoveryPlan -Name $RecoveryPlanName
$job = Update-AzRecoveryServicesAsrProtectionDirection -RecoveryPlan $RP -Direction RecoveryToPrimary
Page URL
https://learn.microsoft.com/en-us/powershell/module/az.recoveryservices/update-azrecoveryservicesasrprotectiondirection?view=azps-12.1.0&viewFallbackFrom=azps-6.3.0
Content source URL
No response
Author
No response
Document Id
No response
The text was updated successfully, but these errors were encountered: