You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Az.Compute] Add gallery image-version soft delete and restore support - #30295
️✔️PowerShell Core - Windows️✔️Windows PowerShell - Windows
Description
Publish the existing changes from anuraganand/softdeletepowershell for feature validation and scenario-test recording, following step 6 of the Azure Compute PowerShell Feature Support Process. This PR contains the branch as reviewed at commit 5c3a4b16c5ceefa477138489f43a0ab67b28f497; it is not yet ready to merge.
Related implementation PR: #30287. This PR uses the user's current branch in their fork and initially contains the same feature commits.
Changes
Add Get-AzGallerySoftDeletedImageVersion for recycle-bin discovery using names, an image-definition resource ID, or pipeline input, with optional client-side version-name filtering.
Add Restore-AzGalleryImageVersion using the original home-region location and the existing image-version PUT operation, with -AsJob support.
Add soft-delete enablement, retention, and grace-period parameters to New-AzGallery and Update-AzGallery, including disablement on update and preservation of omitted policy values.
Add -BypassSoftDelete to all existing Remove-AzGalleryImageVersion parameter sets.
Expose gallery soft-delete policy and shared/community image-version lifecycle response fields.
Update the module manifest, module changelog, reference help, and gallery scenario tests.
Validation performed
dotnet build .\src\Compute\Compute.sln --nologo -v:quiet — failed during package restore with NuGet NU1301 TLS HandshakeFailure errors and NU1900 errors. Local compilation and scenario execution could not be completed.
Scenario tests in Record and Playback modes — not run. Help generation, module import/manual functionality checks, and static analysis — not run.
Known blockers and remaining validation
CI on Add Azure Compute Gallery image-version soft delete and restore #30287 for the same head commit reports CS1061 at GetAzGallerySoftDeletedImageVersion.cs:57: IsParameterBound is unavailable because the extension-method namespace Microsoft.WindowsAzure.Commands.Utilities.Common is not imported. This must be fixed before testing.
TestGallerySoftDeletePolicy has no checked-in recording. The modified Test-Gallery scenario still has its old TestGallery.json recording using Gallery API version 2025-03-03, without the new lifecycle traffic. Record and then verify Playback for both feature scenarios.
Shared/community output types are not included in the Get-AzGalleryImageVersion output-type declaration or help OUTPUTS section.
Complete the issue's required coverage for paging, shared/community GET/LIST response fields, absent consumption timestamps, unknown image states, expired-retention restore errors, missing-resource errors, actual bypass deletion across parameter sets, request contracts, and omitted-policy preservation.
Mandatory Checklist
Please choose the target release of Azure PowerShell. (⚠️Target release is a different concept from API readiness. Please click below links for details.)
These resource-ID and name-based bypass cases use only -WhatIf, so they do not verify the DELETE request. Only pipeline input performs an asserted permanent deletion; the name-based cleanup does not assert its result. Extend the scenario with real bypass deletions for the other two parameter sets, using separate versions. Verify bypassSoftDelete=true in each request and confirm that each version is absent from both active versions and the recycle bin.
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
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.
🤖 PR Validation —⚠️ Review suggested
️✔️Az.Accounts
️✔️Az.KeyVault
️✔️Az.Maintenance
️✔️Az.ManagedServiceIdentity
️✔️Az.Monitor
️✔️Az.Network
️✔️Az.OperationalInsights
️✔️Az.PrivateDns
️✔️Az.RecoveryServices
️✔️Az.ResourceGraph
️✔️Az.Security
️✔️Az.Sql
️✔️Az.Ssh
️✔️Az.Storage
Description
Publish the existing changes from
anuraganand/softdeletepowershellfor feature validation and scenario-test recording, following step 6 of the Azure Compute PowerShell Feature Support Process. This PR contains the branch as reviewed at commit5c3a4b16c5ceefa477138489f43a0ab67b28f497; it is not yet ready to merge.Design review: https://github.com/Azure/azure-powershell-cmdlet-review-pr/issues/1575
Related implementation PR: #30287. This PR uses the user's current branch in their fork and initially contains the same feature commits.
Changes
Get-AzGallerySoftDeletedImageVersionfor recycle-bin discovery using names, an image-definition resource ID, or pipeline input, with optional client-side version-name filtering.Restore-AzGalleryImageVersionusing the original home-region location and the existing image-version PUT operation, with-AsJobsupport.New-AzGalleryandUpdate-AzGallery, including disablement on update and preservation of omitted policy values.-BypassSoftDeleteto all existingRemove-AzGalleryImageVersionparameter sets.Validation performed
dotnet build .\src\Compute\Compute.sln --nologo -v:quiet— failed during package restore with NuGetNU1301TLSHandshakeFailureerrors andNU1900errors. Local compilation and scenario execution could not be completed.[System.Management.Automation.Language.Parser]::ParseFile((Join-Path $PWD 'src\Compute\Compute.Test\ScenarioTests\GalleryTests.ps1'), [ref]$tokens, [ref]$errors)— passed; no PowerShell syntax errors.git diff --check 96a301794e...HEAD— passed.Known blockers and remaining validation
CS1061atGetAzGallerySoftDeletedImageVersion.cs:57:IsParameterBoundis unavailable because the extension-method namespaceMicrosoft.WindowsAzure.Commands.Utilities.Commonis not imported. This must be fixed before testing.TestGallerySoftDeletePolicyhas no checked-in recording. The modifiedTest-Galleryscenario still has its oldTestGallery.jsonrecording using Gallery API version2025-03-03, without the new lifecycle traffic. Record and then verify Playback for both feature scenarios.Get-AzGalleryImageVersionoutput-type declaration or help OUTPUTS section.Mandatory Checklist
Please choose the target release of Azure PowerShell. (⚠️ Target release is a different concept from API readiness. Please click below links for details.)
Check this box to confirm: I have read the Submitting Changes section of
CONTRIBUTING.mdand reviewed the following information:ChangeLog.mdfile(s) appropriatelysrc/Compute/Compute/ChangeLog.md.## Upcoming Releaseheader in the past tense.ChangeLog.mdif no new release is required, such as fixing test case only.Fixes: Fixes Azure/azure-powershell-cmdlet-review-pr#1575