Azure / azure-powershell

Microsoft Azure PowerShell
Other
4.26k stars 3.86k forks source link

https://learn.microsoft.com/en-us/powershell/module/az.recoveryservices/update-azrecoveryservicesasrprotectiondirection?view=azps-12.1.0&viewFallbackFrom=azps-6.3.0[Doc]: #25530

Open sgannavaram opened 4 months ago

sgannavaram commented 4 months ago

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

sgannavaram commented 4 months ago

@Sharmistha-Rai

sgannavaram commented 4 months ago

adding @sideeksh

microsoft-github-policy-service[bot] commented 4 months ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @Sharmistha-Rai.

microsoft-github-policy-service[bot] commented 4 months ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @Sharmistha-Rai.