Skip to content

[Az.Compute] Add gallery image-version soft delete and restore support - #30295

Merged
NoriZC merged 15 commits into
Azure:mainfrom
anuraganand202:anuraganand/softdeletepowershell
Oct 26, 2026
Merged

NoriZC merged 15 commits into
Azure:mainfrom
anuraganand202:anuraganand/softdeletepowershell

Conversation

@anuraganand202

@anuraganand202 Anurag Anand (anuraganand202) commented Oct 14, 2026 •

Copy link
Copy Markdown
Member

🤖 PR Validation — ⚠️ Review suggested

Tests Suppressions
⚠️ 66/66 ️✔️ None
️✔️Az.Accounts
️✔️Build
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
⚠️Az.Compute
️✔️Build
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️Breaking Change Check
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️Signature Check
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
⚠️Help Example Check
⚠️PowerShell Core - Windows
Type Cmdlet Example Line RuleName Description Extent Remediation
⚠️ Get-AzGallerySoftDeletedImageVersion 1 1 Unassigned_Variable Get-AzGallerySoftDeletedImageVersion -ResourceGroupName $rgname is a null-valued parameter value. -ResourceGroupName Assign value for $rgname.
⚠️ Get-AzGallerySoftDeletedImageVersion 1 1 Unassigned_Variable Get-AzGallerySoftDeletedImageVersion -GalleryName $galleryName is a null-valued parameter value. -GalleryName Assign value for $galleryName.
⚠️ Get-AzGallerySoftDeletedImageVersion 1 2 Unassigned_Variable Get-AzGallerySoftDeletedImageVersion -GalleryImageDefinitionName $imageName is a null-valued parameter value. -GalleryImageDefinitionName Assign value for $imageName.
⚠️ Get-AzGallerySoftDeletedImageVersion 2 1 Unassigned_Variable Get-AzGalleryImageDefinition -ResourceGroupName $rgname is a null-valued parameter value. -ResourceGroupName Assign value for $rgname.
⚠️ Get-AzGallerySoftDeletedImageVersion 2 1 Unassigned_Variable Get-AzGalleryImageDefinition -GalleryName $galleryName is a null-valued parameter value. -GalleryName Assign value for $galleryName.
⚠️ Get-AzGallerySoftDeletedImageVersion 2 1 Unassigned_Variable Get-AzGalleryImageDefinition -Name $imageName is a null-valued parameter value. -Name Assign value for $imageName.
⚠️ New-AzGallery 1 1 Unassigned_Variable New-AzGallery -ResourceGroupName $rgname is a null-valued parameter value. -ResourceGroupName Assign value for $rgname.
⚠️ New-AzGallery 1 1 Unassigned_Variable New-AzGallery -Name $galleryName is a null-valued parameter value. -Name Assign value for $galleryName.
⚠️ New-AzGallery 1 1 Unassigned_Variable New-AzGallery -Location $location is a null-valued parameter value. -Location Assign value for $location.
⚠️ New-AzGallery 1 1 Unassigned_Variable New-AzGallery -Description $galleryDescription is a null-valued parameter value. -Description Assign value for $galleryDescription.
⚠️ New-AzGallery 2 1 Unassigned_Variable New-AzGallery -ResourceGroupName $rgname is a null-valued parameter value. -ResourceGroupName Assign value for $rgname.
⚠️ New-AzGallery 2 1 Unassigned_Variable New-AzGallery -Name $galleryName is a null-valued parameter value. -Name Assign value for $galleryName.
⚠️ New-AzGallery 2 1 Unassigned_Variable New-AzGallery -Location $location is a null-valued parameter value. -Location Assign value for $location.
⚠️ New-AzGallery 2 1 Unassigned_Variable New-AzGallery -Description $galleryDescription is a null-valued parameter value. -Description Assign value for $galleryDescription.
⚠️ New-AzGallery 3 1 Unassigned_Variable New-AzGallery -ResourceGroupName $rgname is a null-valued parameter value. -ResourceGroupName Assign value for $rgname.
⚠️ New-AzGallery 3 1 Unassigned_Variable New-AzGallery -Name $galleryName is a null-valued parameter value. -Name Assign value for $galleryName.
⚠️ New-AzGallery 3 1 Unassigned_Variable New-AzGallery -Location $location is a null-valued parameter value. -Location Assign value for $location.
⚠️ New-AzGallery 4 1 Unassigned_Variable Get-AzUserAssignedIdentity -ResourceGroupName $rgname is a null-valued parameter value. -ResourceGroupName Assign value for $rgname.
⚠️ New-AzGallery 4 1 Unassigned_Variable Get-AzUserAssignedIdentity -Name $identityName is a null-valued parameter value. -Name Assign value for $identityName.
⚠️ New-AzGallery 4 2 Unassigned_Variable New-AzGallery -ResourceGroupName $rgname is a null-valued parameter value. -ResourceGroupName Assign value for $rgname.
⚠️ New-AzGallery 4 2 Unassigned_Variable New-AzGallery -Name $galleryName is a null-valued parameter value. -Name Assign value for $galleryName.
⚠️ New-AzGallery 4 2 Unassigned_Variable New-AzGallery -Location $location is a null-valued parameter value. -Location Assign value for $location.
⚠️ New-AzGallery 5 1 Unassigned_Variable New-AzGallery -ResourceGroupName $rgname is a null-valued parameter value. -ResourceGroupName Assign value for $rgname.
⚠️ New-AzGallery 5 1 Unassigned_Variable New-AzGallery -Name $galleryName is a null-valued parameter value. -Name Assign value for $galleryName.
⚠️ New-AzGallery 5 1 Unassigned_Variable New-AzGallery -Location $location is a null-valued parameter value. -Location Assign value for $location.
⚠️ Remove-AzGalleryImageVersion 1 1 Unassigned_Variable Remove-AzGalleryImageVersion -ResourceGroupName $rgname is a null-valued parameter value. -ResourceGroupName Assign value for $rgname.
⚠️ Remove-AzGalleryImageVersion 1 1 Unassigned_Variable Remove-AzGalleryImageVersion -GalleryName $gallery is a null-valued parameter value. -GalleryName Assign value for $gallery.
⚠️ Remove-AzGalleryImageVersion 1 1 Unassigned_Variable Remove-AzGalleryImageVersion -GalleryImageDefinitionName $image is a null-valued parameter value. -GalleryImageDefinitionName Assign value for $image.
⚠️ Remove-AzGalleryImageVersion 1 1 Unassigned_Variable Remove-AzGalleryImageVersion -Name $version is a null-valued parameter value. -Name Assign value for $version.
⚠️ Remove-AzGalleryImageVersion 2 1 Unassigned_Variable Remove-AzGalleryImageVersion -ResourceGroupName $rgname is a null-valued parameter value. -ResourceGroupName Assign value for $rgname.
⚠️ Remove-AzGalleryImageVersion 2 1 Unassigned_Variable Remove-AzGalleryImageVersion -GalleryName $gallery is a null-valued parameter value. -GalleryName Assign value for $gallery.
⚠️ Remove-AzGalleryImageVersion 2 1 Unassigned_Variable Remove-AzGalleryImageVersion -GalleryImageDefinitionName $image is a null-valued parameter value. -GalleryImageDefinitionName Assign value for $image.
⚠️ Remove-AzGalleryImageVersion 2 2 Unassigned_Variable Remove-AzGalleryImageVersion -Name $version is a null-valued parameter value. -Name Assign value for $version.
⚠️ Restore-AzGalleryImageVersion 1 1 Unassigned_Variable Restore-AzGalleryImageVersion -ResourceGroupName $rgname is a null-valued parameter value. -ResourceGroupName Assign value for $rgname.
⚠️ Restore-AzGalleryImageVersion 1 1 Unassigned_Variable Restore-AzGalleryImageVersion -GalleryName $galleryName is a null-valued parameter value. -GalleryName Assign value for $galleryName.
⚠️ Restore-AzGalleryImageVersion 1 2 Unassigned_Variable Restore-AzGalleryImageVersion -GalleryImageDefinitionName $imageName is a null-valued parameter value. -GalleryImageDefinitionName Assign value for $imageName.
⚠️ Update-AzGallery 1 1 Unassigned_Variable Update-AzGallery -ResourceGroupName $rgname is a null-valued parameter value. -ResourceGroupName Assign value for $rgname.
⚠️ Update-AzGallery 1 1 Unassigned_Variable Update-AzGallery -Name $galleryName is a null-valued parameter value. -Name Assign value for $galleryName.
⚠️ Update-AzGallery 1 1 Unassigned_Variable Update-AzGallery -Description $galleryDescription is a null-valued parameter value. -Description Assign value for $galleryDescription.
⚠️ Update-AzGallery 2 1 Unassigned_Variable Update-AzGallery -ResourceGroupName $rgname is a null-valued parameter value. -ResourceGroupName Assign value for $rgname.
⚠️ Update-AzGallery 2 1 Unassigned_Variable Update-AzGallery -Name $galleryName is a null-valued parameter value. -Name Assign value for $galleryName.
⚠️ Update-AzGallery 3 1 Unassigned_Variable Update-AzGallery -ResourceGroupName $rgname is a null-valued parameter value. -ResourceGroupName Assign value for $rgname.
⚠️ Update-AzGallery 3 1 Unassigned_Variable Update-AzGallery -Name $galleryName is a null-valued parameter value. -Name Assign value for $galleryName.
⚠️ Update-AzGallery 4 1 Unassigned_Variable Get-AzUserAssignedIdentity -ResourceGroupName $rgname is a null-valued parameter value. -ResourceGroupName Assign value for $rgname.
⚠️ Update-AzGallery 4 1 Unassigned_Variable Get-AzUserAssignedIdentity -Name $identityName is a null-valued parameter value. -Name Assign value for $identityName.
⚠️ Update-AzGallery 4 2 Unassigned_Variable Get-AzGallery -ResourceGroupName $rgname is a null-valued parameter value. -ResourceGroupName Assign value for $rgname.
⚠️ Update-AzGallery 4 2 Unassigned_Variable Get-AzGallery -Name $galleryName is a null-valued parameter value. -Name Assign value for $galleryName.
⚠️ Update-AzGallery 5 1 Unassigned_Variable Get-AzUserAssignedIdentity -ResourceGroupName $rgname is a null-valued parameter value. -ResourceGroupName Assign value for $rgname.
⚠️ Update-AzGallery 5 1 Unassigned_Variable Get-AzUserAssignedIdentity -Name $identityName1 is a null-valued parameter value. -Name Assign value for $identityName1.
⚠️ Update-AzGallery 5 2 Unassigned_Variable Get-AzUserAssignedIdentity -ResourceGroupName $rgname is a null-valued parameter value. -ResourceGroupName Assign value for $rgname.
⚠️ Update-AzGallery 5 2 Unassigned_Variable Get-AzUserAssignedIdentity -Name $identityName2 is a null-valued parameter value. -Name Assign value for $identityName2.
⚠️ Update-AzGallery 5 3 Unassigned_Variable Update-AzGallery -ResourceGroupName $rgname is a null-valued parameter value. -ResourceGroupName Assign value for $rgname.
⚠️ Update-AzGallery 5 3 Unassigned_Variable Update-AzGallery -Name $galleryName is a null-valued parameter value. -Name Assign value for $galleryName.
⚠️ Update-AzGallery 6 1 Unassigned_Variable Update-AzGallery -ResourceGroupName $rgname is a null-valued parameter value. -ResourceGroupName Assign value for $rgname.
⚠️ Update-AzGallery 6 1 Unassigned_Variable Update-AzGallery -Name $galleryName is a null-valued parameter value. -Name Assign value for $galleryName.
⚠️ Update-AzGallery 7 1 Unassigned_Variable Update-AzGallery -ResourceGroupName $rgname is a null-valued parameter value. -ResourceGroupName Assign value for $rgname.
⚠️ Update-AzGallery 7 1 Unassigned_Variable Update-AzGallery -Name $galleryName is a null-valued parameter value. -Name Assign value for $galleryName.
⚠️ Update-AzGallery 8 1 Unassigned_Variable Get-AzUserAssignedIdentity -ResourceGroupName $rgname is a null-valued parameter value. -ResourceGroupName Assign value for $rgname.
⚠️ Update-AzGallery 8 1 Unassigned_Variable Get-AzUserAssignedIdentity -Name $identityName is a null-valued parameter value. -Name Assign value for $identityName.
⚠️ Update-AzGallery 8 2 Unassigned_Variable Update-AzGallery -ResourceGroupName $rgname is a null-valued parameter value. -ResourceGroupName Assign value for $rgname.
⚠️ Update-AzGallery 8 2 Unassigned_Variable Update-AzGallery -Name $galleryName is a null-valued parameter value. -Name Assign value for $galleryName.
⚠️ Update-AzGallery 9 1 Unassigned_Variable Update-AzGallery -ResourceGroupName $rgname is a null-valued parameter value. -ResourceGroupName Assign value for $rgname.
⚠️ Update-AzGallery 9 1 Unassigned_Variable Update-AzGallery -Name $galleryName is a null-valued parameter value. -Name Assign value for $galleryName.
⚠️Windows PowerShell - Windows
Type Cmdlet Example Line RuleName Description Extent Remediation
⚠️ Get-AzGallerySoftDeletedImageVersion 1 1 Unassigned_Variable Get-AzGallerySoftDeletedImageVersion -ResourceGroupName $rgname is a null-valued parameter value. -ResourceGroupName Assign value for $rgname.
⚠️ Get-AzGallerySoftDeletedImageVersion 1 1 Unassigned_Variable Get-AzGallerySoftDeletedImageVersion -GalleryName $galleryName is a null-valued parameter value. -GalleryName Assign value for $galleryName.
⚠️ Get-AzGallerySoftDeletedImageVersion 1 2 Unassigned_Variable Get-AzGallerySoftDeletedImageVersion -GalleryImageDefinitionName $imageName is a null-valued parameter value. -GalleryImageDefinitionName Assign value for $imageName.
⚠️ Get-AzGallerySoftDeletedImageVersion 2 1 Unassigned_Variable Get-AzGalleryImageDefinition -ResourceGroupName $rgname is a null-valued parameter value. -ResourceGroupName Assign value for $rgname.
⚠️ Get-AzGallerySoftDeletedImageVersion 2 1 Unassigned_Variable Get-AzGalleryImageDefinition -GalleryName $galleryName is a null-valued parameter value. -GalleryName Assign value for $galleryName.
⚠️ Get-AzGallerySoftDeletedImageVersion 2 1 Unassigned_Variable Get-AzGalleryImageDefinition -Name $imageName is a null-valued parameter value. -Name Assign value for $imageName.
⚠️ New-AzGallery 1 1 Unassigned_Variable New-AzGallery -ResourceGroupName $rgname is a null-valued parameter value. -ResourceGroupName Assign value for $rgname.
⚠️ New-AzGallery 1 1 Unassigned_Variable New-AzGallery -Name $galleryName is a null-valued parameter value. -Name Assign value for $galleryName.
⚠️ New-AzGallery 1 1 Unassigned_Variable New-AzGallery -Location $location is a null-valued parameter value. -Location Assign value for $location.
⚠️ New-AzGallery 1 1 Unassigned_Variable New-AzGallery -Description $galleryDescription is a null-valued parameter value. -Description Assign value for $galleryDescription.
⚠️ New-AzGallery 2 1 Unassigned_Variable New-AzGallery -ResourceGroupName $rgname is a null-valued parameter value. -ResourceGroupName Assign value for $rgname.
⚠️ New-AzGallery 2 1 Unassigned_Variable New-AzGallery -Name $galleryName is a null-valued parameter value. -Name Assign value for $galleryName.
⚠️ New-AzGallery 2 1 Unassigned_Variable New-AzGallery -Location $location is a null-valued parameter value. -Location Assign value for $location.
⚠️ New-AzGallery 2 1 Unassigned_Variable New-AzGallery -Description $galleryDescription is a null-valued parameter value. -Description Assign value for $galleryDescription.
⚠️ New-AzGallery 3 1 Unassigned_Variable New-AzGallery -ResourceGroupName $rgname is a null-valued parameter value. -ResourceGroupName Assign value for $rgname.
⚠️ New-AzGallery 3 1 Unassigned_Variable New-AzGallery -Name $galleryName is a null-valued parameter value. -Name Assign value for $galleryName.
⚠️ New-AzGallery 3 1 Unassigned_Variable New-AzGallery -Location $location is a null-valued parameter value. -Location Assign value for $location.
⚠️ New-AzGallery 4 1 Unassigned_Variable Get-AzUserAssignedIdentity -ResourceGroupName $rgname is a null-valued parameter value. -ResourceGroupName Assign value for $rgname.
⚠️ New-AzGallery 4 1 Unassigned_Variable Get-AzUserAssignedIdentity -Name $identityName is a null-valued parameter value. -Name Assign value for $identityName.
⚠️ New-AzGallery 4 2 Unassigned_Variable New-AzGallery -ResourceGroupName $rgname is a null-valued parameter value. -ResourceGroupName Assign value for $rgname.
⚠️ New-AzGallery 4 2 Unassigned_Variable New-AzGallery -Name $galleryName is a null-valued parameter value. -Name Assign value for $galleryName.
⚠️ New-AzGallery 4 2 Unassigned_Variable New-AzGallery -Location $location is a null-valued parameter value. -Location Assign value for $location.
⚠️ New-AzGallery 5 1 Unassigned_Variable New-AzGallery -ResourceGroupName $rgname is a null-valued parameter value. -ResourceGroupName Assign value for $rgname.
⚠️ New-AzGallery 5 1 Unassigned_Variable New-AzGallery -Name $galleryName is a null-valued parameter value. -Name Assign value for $galleryName.
⚠️ New-AzGallery 5 1 Unassigned_Variable New-AzGallery -Location $location is a null-valued parameter value. -Location Assign value for $location.
⚠️ Remove-AzGalleryImageVersion 1 1 Unassigned_Variable Remove-AzGalleryImageVersion -ResourceGroupName $rgname is a null-valued parameter value. -ResourceGroupName Assign value for $rgname.
⚠️ Remove-AzGalleryImageVersion 1 1 Unassigned_Variable Remove-AzGalleryImageVersion -GalleryName $gallery is a null-valued parameter value. -GalleryName Assign value for $gallery.
⚠️ Remove-AzGalleryImageVersion 1 1 Unassigned_Variable Remove-AzGalleryImageVersion -GalleryImageDefinitionName $image is a null-valued parameter value. -GalleryImageDefinitionName Assign value for $image.
⚠️ Remove-AzGalleryImageVersion 1 1 Unassigned_Variable Remove-AzGalleryImageVersion -Name $version is a null-valued parameter value. -Name Assign value for $version.
⚠️ Remove-AzGalleryImageVersion 2 1 Unassigned_Variable Remove-AzGalleryImageVersion -ResourceGroupName $rgname is a null-valued parameter value. -ResourceGroupName Assign value for $rgname.
⚠️ Remove-AzGalleryImageVersion 2 1 Unassigned_Variable Remove-AzGalleryImageVersion -GalleryName $gallery is a null-valued parameter value. -GalleryName Assign value for $gallery.
⚠️ Remove-AzGalleryImageVersion 2 1 Unassigned_Variable Remove-AzGalleryImageVersion -GalleryImageDefinitionName $image is a null-valued parameter value. -GalleryImageDefinitionName Assign value for $image.
⚠️ Remove-AzGalleryImageVersion 2 2 Unassigned_Variable Remove-AzGalleryImageVersion -Name $version is a null-valued parameter value. -Name Assign value for $version.
⚠️ Restore-AzGalleryImageVersion 1 1 Unassigned_Variable Restore-AzGalleryImageVersion -ResourceGroupName $rgname is a null-valued parameter value. -ResourceGroupName Assign value for $rgname.
⚠️ Restore-AzGalleryImageVersion 1 1 Unassigned_Variable Restore-AzGalleryImageVersion -GalleryName $galleryName is a null-valued parameter value. -GalleryName Assign value for $galleryName.
⚠️ Restore-AzGalleryImageVersion 1 2 Unassigned_Variable Restore-AzGalleryImageVersion -GalleryImageDefinitionName $imageName is a null-valued parameter value. -GalleryImageDefinitionName Assign value for $imageName.
⚠️ Update-AzGallery 1 1 Unassigned_Variable Update-AzGallery -ResourceGroupName $rgname is a null-valued parameter value. -ResourceGroupName Assign value for $rgname.
⚠️ Update-AzGallery 1 1 Unassigned_Variable Update-AzGallery -Name $galleryName is a null-valued parameter value. -Name Assign value for $galleryName.
⚠️ Update-AzGallery 1 1 Unassigned_Variable Update-AzGallery -Description $galleryDescription is a null-valued parameter value. -Description Assign value for $galleryDescription.
⚠️ Update-AzGallery 2 1 Unassigned_Variable Update-AzGallery -ResourceGroupName $rgname is a null-valued parameter value. -ResourceGroupName Assign value for $rgname.
⚠️ Update-AzGallery 2 1 Unassigned_Variable Update-AzGallery -Name $galleryName is a null-valued parameter value. -Name Assign value for $galleryName.
⚠️ Update-AzGallery 3 1 Unassigned_Variable Update-AzGallery -ResourceGroupName $rgname is a null-valued parameter value. -ResourceGroupName Assign value for $rgname.
⚠️ Update-AzGallery 3 1 Unassigned_Variable Update-AzGallery -Name $galleryName is a null-valued parameter value. -Name Assign value for $galleryName.
⚠️ Update-AzGallery 4 1 Unassigned_Variable Get-AzUserAssignedIdentity -ResourceGroupName $rgname is a null-valued parameter value. -ResourceGroupName Assign value for $rgname.
⚠️ Update-AzGallery 4 1 Unassigned_Variable Get-AzUserAssignedIdentity -Name $identityName is a null-valued parameter value. -Name Assign value for $identityName.
⚠️ Update-AzGallery 4 2 Unassigned_Variable Get-AzGallery -ResourceGroupName $rgname is a null-valued parameter value. -ResourceGroupName Assign value for $rgname.
⚠️ Update-AzGallery 4 2 Unassigned_Variable Get-AzGallery -Name $galleryName is a null-valued parameter value. -Name Assign value for $galleryName.
⚠️ Update-AzGallery 5 1 Unassigned_Variable Get-AzUserAssignedIdentity -ResourceGroupName $rgname is a null-valued parameter value. -ResourceGroupName Assign value for $rgname.
⚠️ Update-AzGallery 5 1 Unassigned_Variable Get-AzUserAssignedIdentity -Name $identityName1 is a null-valued parameter value. -Name Assign value for $identityName1.
⚠️ Update-AzGallery 5 2 Unassigned_Variable Get-AzUserAssignedIdentity -ResourceGroupName $rgname is a null-valued parameter value. -ResourceGroupName Assign value for $rgname.
⚠️ Update-AzGallery 5 2 Unassigned_Variable Get-AzUserAssignedIdentity -Name $identityName2 is a null-valued parameter value. -Name Assign value for $identityName2.
⚠️ Update-AzGallery 5 3 Unassigned_Variable Update-AzGallery -ResourceGroupName $rgname is a null-valued parameter value. -ResourceGroupName Assign value for $rgname.
⚠️ Update-AzGallery 5 3 Unassigned_Variable Update-AzGallery -Name $galleryName is a null-valued parameter value. -Name Assign value for $galleryName.
⚠️ Update-AzGallery 6 1 Unassigned_Variable Update-AzGallery -ResourceGroupName $rgname is a null-valued parameter value. -ResourceGroupName Assign value for $rgname.
⚠️ Update-AzGallery 6 1 Unassigned_Variable Update-AzGallery -Name $galleryName is a null-valued parameter value. -Name Assign value for $galleryName.
⚠️ Update-AzGallery 7 1 Unassigned_Variable Update-AzGallery -ResourceGroupName $rgname is a null-valued parameter value. -ResourceGroupName Assign value for $rgname.
⚠️ Update-AzGallery 7 1 Unassigned_Variable Update-AzGallery -Name $galleryName is a null-valued parameter value. -Name Assign value for $galleryName.
⚠️ Update-AzGallery 8 1 Unassigned_Variable Get-AzUserAssignedIdentity -ResourceGroupName $rgname is a null-valued parameter value. -ResourceGroupName Assign value for $rgname.
⚠️ Update-AzGallery 8 1 Unassigned_Variable Get-AzUserAssignedIdentity -Name $identityName is a null-valued parameter value. -Name Assign value for $identityName.
⚠️ Update-AzGallery 8 2 Unassigned_Variable Update-AzGallery -ResourceGroupName $rgname is a null-valued parameter value. -ResourceGroupName Assign value for $rgname.
⚠️ Update-AzGallery 8 2 Unassigned_Variable Update-AzGallery -Name $galleryName is a null-valued parameter value. -Name Assign value for $galleryName.
⚠️ Update-AzGallery 9 1 Unassigned_Variable Update-AzGallery -ResourceGroupName $rgname is a null-valued parameter value. -ResourceGroupName Assign value for $rgname.
⚠️ Update-AzGallery 9 1 Unassigned_Variable Update-AzGallery -Name $galleryName is a null-valued parameter value. -Name Assign value for $galleryName.
️✔️Help File Existence Check
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️File Change Check
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️UX Metadata Check
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️Test
️✔️PowerShell Core - Linux
️✔️PowerShell Core - MacOS
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️Az.KeyVault
️✔️Build
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️Az.Maintenance
️✔️Build
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️Test
️✔️PowerShell Core - Linux
️✔️PowerShell Core - MacOS
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️Az.ManagedServiceIdentity
️✔️Build
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️Az.Monitor
️✔️Build
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️Az.Network
️✔️Build
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️Test
️✔️PowerShell Core - Linux
️✔️PowerShell Core - MacOS
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️Az.OperationalInsights
️✔️Build
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️Az.PrivateDns
️✔️Build
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️Az.RecoveryServices
️✔️Build
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️Test
️✔️PowerShell Core - Linux
️✔️PowerShell Core - MacOS
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️Az.ResourceGraph
️✔️Build
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️Az.Security
️✔️Build
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️Test
️✔️PowerShell Core - Linux
️✔️PowerShell Core - MacOS
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️Az.Sql
️✔️Build
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️Az.Ssh
️✔️Build
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️Test
️✔️PowerShell Core - Linux
️✔️PowerShell Core - MacOS
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️Az.Storage
️✔️Build
️✔️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.

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

  • 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.
  • [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.
  • 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

  • SHOULD update ChangeLog.md file(s) appropriately
    • Update src/Compute/Compute/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
    Fixes: Fixes Azure/azure-powershell-cmdlet-review-pr#1575

Copilot AI and others added 4 commits October 13, 2026 14:25
Co-authored-by: audreyttt <225061541+audreyttt@users.noreply.github.com>
Co-authored-by: audreyttt <225061541+audreyttt@users.noreply.github.com>
Co-authored-by: audreyttt <225061541+audreyttt@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings October 14, 2026 12:21
@azure-pipelines

Copy link
Copy Markdown
Contributor
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Az.Compute currently fails compilation, and required playback recordings, output metadata, and scenario coverage are incomplete.

10 open findings
What changed in this PR

Adds Azure Compute Gallery image-version soft-delete discovery, restoration, policy management, and permanent deletion support.

Changes:

  • Adds recycle-bin discovery and restore cmdlets.
  • Adds gallery soft-delete policy controls and lifecycle properties.
  • Updates exports, help, changelog, and scenario tests.
File Description
help/​Update-AzGallery.md Documents update policy parameters.
help/​Restore-AzGalleryImageVersion.md Adds restore cmdlet help.
help/​Remove-AzGalleryImageVersion.md Documents bypass deletion.
help/​New-AzGallery.md Documents creation policy parameters.
help/​Get-AzGallerySoftDeletedImageVersion.md Adds recycle-bin discovery help.
help/​Get-AzGalleryImageVersion.md Documents lifecycle fields.
help/​Get-AzGallery.md Documents soft-delete policy output.
help/​Az.Compute.md Indexes new cmdlets.
PSSharedGalleryImageVersion.cs Adds lifecycle properties.
PSGallerySoftDeletedImageVersion.cs Adds recycle-bin output model.
PSGallery.cs Exposes soft-delete policy.
PSCommunityGalleryImageVersion.cs Adds lifecycle properties.
RestoreAzGalleryImageVersion.cs Implements image-version restoration.
GetAzGallerySoftDeletedImageVersion.cs Implements recycle-bin listing and filtering.
GalleryImageVersionDeleteMethod.cs Adds bypass-soft-delete requests.
GalleryCreateOrUpdateMethod.cs Adds policy creation and update logic.
ChangeLog.md Records the feature.
Az.Compute.psd1 Exports the new cmdlets.
GalleryTests.ps1 Adds feature scenarios.
GalleryTests.cs Registers the policy scenario.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/Compute/Compute/ChangeLog.md Resolved
@a0x1ab

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Contributor
Azure Pipelines:
Successfully started running 3 pipeline(s).

…leted version cmdlet

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 62d295fc-888e-4c95-b1c8-099a8b5ae525
Copilot AI balanced review requested due to automatic review settings October 14, 2026 18:10

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

}

var client = ComputeClient.ComputeManagementClient.SoftDeletedResource;
var page = client.ListByArtifactName(resourceGroupName, galleryName, "Images", galleryImageDefinitionName);
@a0x1ab

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Contributor
Azure Pipelines:
Successfully started running 3 pipeline(s).

Copilot AI balanced review requested due to automatic review settings October 15, 2026 03:31

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

@a0x1ab

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Contributor
Azure Pipelines:
Successfully started running 3 pipeline(s).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 62d295fc-888e-4c95-b1c8-099a8b5ae525
Copilot AI balanced review requested due to automatic review settings October 15, 2026 14:34

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

@NoriZC

NoriZC commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

/azp run

@azure-pipelines

Copy link
Copy Markdown
Contributor
Azure Pipelines:
Successfully started running 3 pipeline(s).

@a0x1ab

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Contributor
Azure Pipelines:
Successfully started running 3 pipeline(s).

@a0x1ab

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Contributor
Azure Pipelines:
Successfully started running 3 pipeline(s).

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

@anuraganand202

Copy link
Copy Markdown
Member Author

@microsoft-github-policy-service agree company="Microsoft"

Revert the API-version changes from 5e7f1c0.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 93a88bd9-436b-4440-b898-8c5e8dd5f30b
Copilot AI balanced review requested due to automatic review settings October 23, 2026 15:43
@a0x1ab

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Contributor
Azure Pipelines:
Successfully started running 3 pipeline(s).

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

The reported generated-SDK verification failures require human validation before merge.

1 open issue
1 previously missed issue

In code that hasn't changed since last review

Low severity Verify real permanent deletion for all bypass parameter sets

src/​Compute/​Compute.Test/​ScenarioTests/​GalleryTests.ps1:449

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.

2 resolved since last review

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings October 24, 2026 03:03
@a0x1ab

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Contributor
Azure Pipelines:
Successfully started running 3 pipeline(s).

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

The lifecycle changes need further regression validation, including the advertised asynchronous restore workflow, before safe approval.

2 open issues

Review effort: Balanced

Comment on lines +59 to +60
[Parameter(Mandatory = false, HelpMessage = "Run cmdlet in the background")]
public SwitchParameter AsJob { get; set; }
@NoriZC
NoriZC merged commit 421f2ad into Azure:main Oct 26, 2026
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.

6 participants