azurebackup: Fix RSV CRR live test failure - handle CloudInternalError when CRR already enabled#2599
Open
shrja-ms wants to merge 1 commit into
Open
azurebackup: Fix RSV CRR live test failure - handle CloudInternalError when CRR already enabled#2599shrja-ms wants to merge 1 commit into
shrja-ms wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes an azurebackup live test failure when enabling Cross-Region Restore (CRR) on an RSV vault where CRR is already enabled but cannot be detected via the existing pre-check, by treating a specific backend failure (CloudInternalError) from the Vault PATCH as an idempotent success.
Changes:
- Wraps the RSV Vault PATCH update call in a
try/catchthat convertsRequestFailedExceptionwithErrorCode == "CloudInternalError"into a successful “already enabled” result.
2b5fec7 to
c31536f
Compare
…esourceConfig API The RSV ConfigureCrossRegionRestoreAsync failed in CI when CRR was already enabled because the Vault GET RedundancySettings.CrossRegionRestore property is not populated when CRR was set via the legacy BackupResourceConfig API. Fix: Add pre-check using BackupResourceConfig.EnableCrossRegionRestore (the same API already being called to set CRR). This property reliably returns the CRR state regardless of how it was originally configured.
c31536f to
048eb2c
Compare
Contributor
|
/azp run mcp - pullrequest - live |
|
Azure Pipelines successfully started running 1 pipeline(s). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The
DisasterRecoveryEnableCrr_RsvVault_EnablesCrossRegionRestore_Successfullylive test fails on main with aCloudInternalError (500)when CRR is already enabled on the RSV vault.CI failure: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=6255795&view=logs&j=91fe1db5-1f25-54d9-1b80-aa22561a2991&t=59d2fd0c-a3cd-5700-1f52-546eceebcd75
Root Cause
The RSV
ConfigureCrossRegionRestoreAsyncmethod has two defenses against re-enabling CRR, but both fail in CI:Pre-check fails:
GET /vaults/{vaultName}does not populateproperties.redundancySettings.crossRegionRestorewhen CRR was originally configured via the legacyBackupResourceConfigAPI. The pre-check (CrossRegionRestore == Enabled) evaluates to false even though CRR is actually enabled.Vault PATCH returns generic error: The fallback PATCH call throws
CloudInternalError (500)with no CRR-specific sub-code (target: null,details: null), making it indistinguishable from a genuine service failure. This is an Azure Backup RSV API gap (VSO bug filed requesting either idempotent success or a specific error code likeCrossRegionRestoreAlreadyEnabled).Fix
Wrap the Vault PATCH call inside the
BMSUserErrorRedundancySettingsUseVaultApicatch block with a nestedtry/catchforCloudInternalError, treating it as "already enabled" -- consistent with the DPP implementation pattern and the command's[Idempotent = true]metadata.Changes
RsvBackupOperations.cs-- Addedtry/catch (RequestFailedException patchEx) when (patchEx.ErrorCode == "CloudInternalError")around the Vault PATCH call, returning success with an "already enabled" message.Testing
Invoking Livetests
Copilot submitted PRs are not trustworthy by default. Users with
writeaccess to the repo need to validate the contents of this PR before leaving a comment with the text/azp run mcp - pullrequest - live. This will trigger the necessary livetest workflows to complete required validation.