Skip to content

Conversation

@hiaga
Copy link
Member

@hiaga hiaga commented Sep 29, 2025

Description

Added support for vault soft delete

Mandatory Checklist

  • SHOULD update ChangeLog.md file(s) appropriately
    • Update src/{{SERVICE}}/{{SERVICE}}/ChangeLog.md.
      • A snippet outlining the change(s) made in the PR should be written under the ## Upcoming Release header in the past tense.
    • Should not change ChangeLog.md if no new release is required, such as fixing test case only.
  • SHOULD regenerate markdown help files if there is cmdlet API change. Instruction
  • SHOULD have proper test coverage for changes in pull request.
  • SHOULD NOT adjust version of module manually in pull request

Copilot AI review requested due to automatic review settings September 29, 2025 03:17
@azure-client-tools-bot-prd
Copy link

Thanks for your contribution! The pull request validation has started. Please revisit this comment for updated status.

@hiaga hiaga added this to the Az 14.5.0 (10/14/2025) milestone Sep 29, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support for vault soft delete functionality to the Azure Recovery Services module. The soft delete feature allows vaults to be recoverable for a retention period after deletion rather than being permanently removed.

Key changes include:

  • Addition of three new cmdlets for managing soft-deleted vaults and retrieving their backup items
  • Implementation of Azure Resource Graph (ARG) integration for querying soft-deleted vault backup items
  • Extended model classes to support soft-deleted vault scenarios

Reviewed Changes

Copilot reviewed 29 out of 110 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
UndoAzRecoveryServicesVaultDeletion.cs Implements cmdlet to restore soft-deleted vaults to active state
GetAzureRmRecoveryServicesSoftDeletedVault.cs Implements cmdlet to retrieve soft-deleted vaults by location and filters
GetAzureRmRecoveryServicesSoftDeletedVaultBackupItem.cs Implements cmdlet to query backup items from soft-deleted vaults using ARG
PSRecoveryServicesVaultClient.cs Adds client methods for soft-deleted vault operations
ConversionHelpers.cs Adds conversion logic for ARG responses to backup item models
Multiple model files Defines soft-deleted vault item classes extending existing backup item types
Help documentation Provides comprehensive cmdlet documentation and usage examples
Comments suppressed due to low confidence (1)

src/RecoveryServices/RecoveryServices/help/Get-AzRecoveryServicesSoftDeletedVaultBackupItem.md:1

  • The description should be 'Gets backup items from soft-deleted Recovery Services vaults' (plural) to match the cmdlet's functionality of querying multiple vaults.
---

/// Undeletes a soft deleted Azure Recovery Services Vault.
/// </summary>
[Cmdlet("Undo", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "RecoveryServicesVaultDeletion", SupportsShouldProcess = true)]
[OutputType(typeof(Object))] // chck: ServeClientModel.OperationStatus
Copy link

Copilot AI Sep 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment contains a typo 'chck' which should be 'check'.

Copilot uses AI. Check for mistakes.

WriteVerbose($"Undelete operation completed for vault '{this.Name}'");

this.WriteObject(new ARSSoftDeletedVault(undeleteResult)); // chck with Rishav what should be the output type here.
Copy link

Copilot AI Sep 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment contains a typo 'chck' which should be 'check'.

Suggested change
this.WriteObject(new ARSSoftDeletedVault(undeleteResult)); // chck with Rishav what should be the output type here.
this.WriteObject(new ARSSoftDeletedVault(undeleteResult)); // check with Rishav what should be the output type here.

Copilot uses AI. Check for mistakes.
@isra-fel
Copy link
Member

/azp run

@azure-pipelines
Copy link
Contributor

Azure Pipelines successfully started running 3 pipeline(s).

Copy link
Collaborator

@VeryEarly VeryEarly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please fix failed test cases

@hiaga
Copy link
Member Author

hiaga commented Sep 29, 2025

please fix failed test cases

rerecording the failed tests

@isra-fel isra-fel changed the base branch from main to release-2025-10-14 October 2, 2025 07:16
@github-actions
Copy link

github-actions bot commented Oct 2, 2025

This PR was labeled "needs-revision" because it has unresolved review comments or CI failures.
Please resolve all open review comments and make sure all CI checks are green. Refer to our guide to troubleshoot common CI failures.

@isra-fel
Copy link
Member

/azp run

@azure-pipelines
Copy link
Contributor

Azure Pipelines successfully started running 3 pipeline(s).

@hiaga hiaga removed their assignment Oct 28, 2025
@isra-fel
Copy link
Member

/azp run

@azure-pipelines
Copy link
Contributor

Azure Pipelines successfully started running 3 pipeline(s).

@isra-fel
Copy link
Member

LGTM with the only issue being having to delete the "PS C:" prompt from the examples


### Example 2: Get a specific soft-deleted vault by name
```powershell
PS C:\> Get-AzRecoveryServicesSoftDeletedVault -Location "westus" -Name "wus-rg_fe7567gh-9d2b-4376-aa4a-de1c7176e40e" -ResourceGroupName "wus-rg"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
PS C:\> Get-AzRecoveryServicesSoftDeletedVault -Location "westus" -Name "wus-rg_fe7567gh-9d2b-4376-aa4a-de1c7176e40e" -ResourceGroupName "wus-rg"
Get-AzRecoveryServicesSoftDeletedVault -Location "westus" -Name "wus-rg_fe7567gh-9d2b-4376-aa4a-de1c7176e40e" -ResourceGroupName "wus-rg"


### Example 3: Filter soft-deleted vaults by original vault name
```powershell
PS C:\> $sdVault = Get-AzRecoveryServicesSoftDeletedVault -Location westus | Where-Object { $_.Properties.VaultId -match "wus-vault" }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
PS C:\> $sdVault = Get-AzRecoveryServicesSoftDeletedVault -Location westus | Where-Object { $_.Properties.VaultId -match "wus-vault" }
$sdVault = Get-AzRecoveryServicesSoftDeletedVault -Location westus | Where-Object { $_.Properties.VaultId -match "wus-vault" }

Comment on lines 35 to 36
PS C:\> $sdVault = Get-AzRecoveryServicesSoftDeletedVault -Location westus -Name "wus-rg_fe7567gh-9d2b-4376-aa4a-de1c7176e40e"
PS C:\> Get-AzRecoveryServicesSoftDeletedVaultBackupItem -VaultName $sdVault.Name -ResourceGroupName $sdVault.ResourceGroupName
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
PS C:\> $sdVault = Get-AzRecoveryServicesSoftDeletedVault -Location westus -Name "wus-rg_fe7567gh-9d2b-4376-aa4a-de1c7176e40e"
PS C:\> Get-AzRecoveryServicesSoftDeletedVaultBackupItem -VaultName $sdVault.Name -ResourceGroupName $sdVault.ResourceGroupName
$sdVault = Get-AzRecoveryServicesSoftDeletedVault -Location westus -Name "wus-rg_fe7567gh-9d2b-4376-aa4a-de1c7176e40e"
Get-AzRecoveryServicesSoftDeletedVaultBackupItem -VaultName $sdVault.Name -ResourceGroupName $sdVault.ResourceGroupName

@github-actions
Copy link

This PR was labeled "needs-revision" because it has unresolved review comments or CI failures.
Please resolve all open review comments and make sure all CI checks are green. Refer to our guide to troubleshoot common CI failures.

@hiaga hiaga removed their assignment Oct 29, 2025
@isra-fel
Copy link
Member

/azp run

@azure-pipelines
Copy link
Contributor

Azure Pipelines successfully started running 3 pipeline(s).

@isra-fel
Copy link
Member

Please check the password detected by security tools

@hiaga
Copy link
Member Author

hiaga commented Oct 29, 2025

image

@isra-fel I do not have access to check security tools

@isra-fel
Copy link
Member

/azp run

@azure-pipelines
Copy link
Contributor

Azure Pipelines successfully started running 3 pipeline(s).

@isra-fel isra-fel merged commit 2648670 into Azure:release-2025-11-04 Oct 29, 2025
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants