Skip to content

Add Get-AzSharedVMExtensionVersion and Set-AzSharedVMExtensionVersionDeprecation cmdlets - #30122

Draft
Audrey Toney (audreyttt) with Copilot wants to merge 2 commits into
Az.Compute-privatefrom
copilot/add-get-schedule-deprecation
Draft

Add Get-AzSharedVMExtensionVersion and Set-AzSharedVMExtensionVersionDeprecation cmdlets#30122
Audrey Toney (audreyttt) with Copilot wants to merge 2 commits into
Az.Compute-privatefrom
copilot/add-get-schedule-deprecation

Conversation

Copilot AI commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

🤖 PR Validation — ❌ Action needed

Tests
❌ 38/64
️✔️Az.Accounts
️✔️Build
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
❌Az.Compute
❌Build
❌PowerShell Core - Windows
Type Code Position Detail
CS0120 D:\a_work\1\s\src\Compute\Compute\Manual\SetAzSharedVMExtensionVersionDeprecation.cs(89,22) An object reference is required for the non-static field, method, or property 'SetAzSharedVMExtensionVersionDeprecation.DeprecationType' [D:\a_work\1\s\src\Compute\Compute\Compute.csproj]
CS0120 D:\a_work\1\s\src\Compute\Compute\Manual\SetAzSharedVMExtensionVersionDeprecation.cs(89,46) An object reference is required for the non-static field, method, or property 'SetAzSharedVMExtensionVersionDeprecation.DeprecationType' [D:\a_work\1\s\src\Compute\Compute\Compute.csproj]
CS0120 D:\a_work\1\s\src\Compute\Compute\Manual\SetAzSharedVMExtensionVersionDeprecation.cs(89,69) An object reference is required for the non-static field, method, or property 'SetAzSharedVMExtensionVersionDeprecation.DeprecationType' [D:\a_work\1\s\src\Compute\Compute\Compute.csproj]
CS0120 D:\a_work\1\s\src\Compute\Compute\Manual\SetAzSharedVMExtensionVersionDeprecation.cs(89,92) An object reference is required for the non-static field, method, or property 'SetAzSharedVMExtensionVersionDeprecation.DeprecationType' [D:\a_work\1\s\src\Compute\Compute\Compute.csproj]
❌Windows PowerShell - Windows
Type Code Position Detail
CS0120 D:\a_work\1\s\src\Compute\Compute\Manual\SetAzSharedVMExtensionVersionDeprecation.cs(89,22) An object reference is required for the non-static field, method, or property 'SetAzSharedVMExtensionVersionDeprecation.DeprecationType' [D:\a_work\1\s\src\Compute\Compute\Compute.csproj]
CS0120 D:\a_work\1\s\src\Compute\Compute\Manual\SetAzSharedVMExtensionVersionDeprecation.cs(89,46) An object reference is required for the non-static field, method, or property 'SetAzSharedVMExtensionVersionDeprecation.DeprecationType' [D:\a_work\1\s\src\Compute\Compute\Compute.csproj]
CS0120 D:\a_work\1\s\src\Compute\Compute\Manual\SetAzSharedVMExtensionVersionDeprecation.cs(89,69) An object reference is required for the non-static field, method, or property 'SetAzSharedVMExtensionVersionDeprecation.DeprecationType' [D:\a_work\1\s\src\Compute\Compute\Compute.csproj]
CS0120 D:\a_work\1\s\src\Compute\Compute\Manual\SetAzSharedVMExtensionVersionDeprecation.cs(89,92) An object reference is required for the non-static field, method, or property 'SetAzSharedVMExtensionVersionDeprecation.DeprecationType' [D:\a_work\1\s\src\Compute\Compute\Compute.csproj]
️✔️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-AzSharedVMExtensionVersion 1 1 Invalid_Cmdlet Get-AzSharedVMExtensionVersion is not a valid command name. Get-AzSharedVMExtensionVersion -ResourceGroupName 'myResourceGroup' -SharedVMExtensionName 'myVMExtension' -Version '1.0.0' Check the spell of Get-AzSharedVMExtensionVersion.
Set-AzSharedVMExtensionVersionDeprecation 1 1 Invalid_Cmdlet Set-AzSharedVMExtensionVersionDeprecation is not a valid command name. Set-AzSharedVMExtensionVersionDeprecation -ResourceGroupName 'myResourceGroup' -SharedVMExtensionName 'myVMExtension' -Version '1.0.0' -DeprecationState 'ScheduledForDeprecation' -DaysUntilDeprecation 90 -DeprecationType 'Minor' Check the spell of Set-AzSharedVMExtensionVersionDeprecation.
Set-AzSharedVMExtensionVersionDeprecation 2 1 Invalid_Cmdlet Get-AzSharedVMExtensionVersion is not a valid command name. Get-AzSharedVMExtensionVersion -ResourceGroupName 'myResourceGroup' -SharedVMExtensionName 'myVMExtension' -Version '1.0.0' Check the spell of Get-AzSharedVMExtensionVersion.
Set-AzSharedVMExtensionVersionDeprecation 2 1 Invalid_Cmdlet Set-AzSharedVMExtensionVersionDeprecation is not a valid command name. Set-AzSharedVMExtensionVersionDeprecation -DeprecationState 'Active' Check the spell of Set-AzSharedVMExtensionVersionDeprecation.
❌Windows PowerShell - Windows
Type Cmdlet Example Line RuleName Description Extent Remediation
Get-AzSharedVMExtensionVersion 1 1 Invalid_Cmdlet Get-AzSharedVMExtensionVersion is not a valid command name. Get-AzSharedVMExtensionVersion -ResourceGroupName 'myResourceGroup' -SharedVMExtensionName 'myVMExtension' -Version '1.0.0' Check the spell of Get-AzSharedVMExtensionVersion.
Set-AzSharedVMExtensionVersionDeprecation 1 1 Invalid_Cmdlet Set-AzSharedVMExtensionVersionDeprecation is not a valid command name. Set-AzSharedVMExtensionVersionDeprecation -ResourceGroupName 'myResourceGroup' -SharedVMExtensionName 'myVMExtension' -Version '1.0.0' -DeprecationState 'ScheduledForDeprecation' -DaysUntilDeprecation 90 -DeprecationType 'Minor' Check the spell of Set-AzSharedVMExtensionVersionDeprecation.
Set-AzSharedVMExtensionVersionDeprecation 2 1 Invalid_Cmdlet Get-AzSharedVMExtensionVersion is not a valid command name. Get-AzSharedVMExtensionVersion -ResourceGroupName 'myResourceGroup' -SharedVMExtensionName 'myVMExtension' -Version '1.0.0' Check the spell of Get-AzSharedVMExtensionVersion.
Set-AzSharedVMExtensionVersionDeprecation 2 1 Invalid_Cmdlet Set-AzSharedVMExtensionVersionDeprecation is not a valid command name. Set-AzSharedVMExtensionVersionDeprecation -DeprecationState 'Active' Check the spell of Set-AzSharedVMExtensionVersionDeprecation.
️✔️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
Type Module ResourceType SubResourceType Command Description
Az.Compute Microsoft.Compute disks Get-AzDisk Cmdlet Get-AzDisk is not contained in Az.Compute.
Az.Compute Microsoft.Compute disks Remove-AzDisk Cmdlet Remove-AzDisk is not contained in Az.Compute.
Az.Compute Microsoft.Compute virtualMachines Get-AzVM Cmdlet Get-AzVM is not contained in Az.Compute.
Az.Compute Microsoft.Compute virtualMachines Stop-AzVM Cmdlet Stop-AzVM is not contained in Az.Compute.
Az.Compute Microsoft.Compute virtualMachines Start-AzVM Cmdlet Start-AzVM is not contained in Az.Compute.
Az.Compute Microsoft.Compute virtualMachines Restart-AzVM Cmdlet Restart-AzVM is not contained in Az.Compute.
Az.Compute Microsoft.Compute virtualMachineScaleSets-virtualMachines-runCommands Get-AzVmssVMRunCommand Cmdlet Get-AzVmssVMRunCommand is not contained in Az.Compute.
Az.Compute Microsoft.Compute virtualMachineScaleSets-virtualMachines Get-AzVmssVM Cmdlet Get-AzVmssVM is not contained in Az.Compute.
Az.Compute Microsoft.Compute virtualMachineScaleSets Get-AzVmss Cmdlet Get-AzVmss is not contained in Az.Compute.
Az.Compute Microsoft.Compute virtualMachineScaleSets Get-AzVmssRollingUpgrade Cmdlet Get-AzVmssRollingUpgrade is not contained in Az.Compute.
Az.Compute Microsoft.Compute virtualMachineScaleSets Restart-AzVmss Cmdlet Restart-AzVmss is not contained in Az.Compute.
Az.Compute Microsoft.Compute virtualMachineScaleSets Start-AzVmss Cmdlet Start-AzVmss is not contained in Az.Compute.
Az.Compute Microsoft.Compute virtualMachineScaleSets Start-AzVmssRollingExtensionUpgrade Cmdlet Start-AzVmssRollingExtensionUpgrade is not contained in Az.Compute.
Az.Compute Microsoft.Compute virtualMachineScaleSets Start-AzVmssRollingOSUpgrade Cmdlet Start-AzVmssRollingOSUpgrade is not contained in Az.Compute.
Az.Compute Microsoft.Compute virtualMachineScaleSets Stop-AzVmss Cmdlet Stop-AzVmss is not contained in Az.Compute.
Az.Compute Microsoft.Compute virtualMachineScaleSets Stop-AzVmssRollingUpgrade Cmdlet Stop-AzVmssRollingUpgrade is not contained in Az.Compute.
❌Windows PowerShell - Windows
Type Module ResourceType SubResourceType Command Description
Az.Compute Microsoft.Compute disks Get-AzDisk Cmdlet Get-AzDisk is not contained in Az.Compute.
Az.Compute Microsoft.Compute disks Remove-AzDisk Cmdlet Remove-AzDisk is not contained in Az.Compute.
Az.Compute Microsoft.Compute virtualMachines Get-AzVM Cmdlet Get-AzVM is not contained in Az.Compute.
Az.Compute Microsoft.Compute virtualMachines Stop-AzVM Cmdlet Stop-AzVM is not contained in Az.Compute.
Az.Compute Microsoft.Compute virtualMachines Start-AzVM Cmdlet Start-AzVM is not contained in Az.Compute.
Az.Compute Microsoft.Compute virtualMachines Restart-AzVM Cmdlet Restart-AzVM is not contained in Az.Compute.
Az.Compute Microsoft.Compute virtualMachineScaleSets-virtualMachines-runCommands Get-AzVmssVMRunCommand Cmdlet Get-AzVmssVMRunCommand is not contained in Az.Compute.
Az.Compute Microsoft.Compute virtualMachineScaleSets-virtualMachines Get-AzVmssVM Cmdlet Get-AzVmssVM is not contained in Az.Compute.
Az.Compute Microsoft.Compute virtualMachineScaleSets Get-AzVmss Cmdlet Get-AzVmss is not contained in Az.Compute.
Az.Compute Microsoft.Compute virtualMachineScaleSets Get-AzVmssRollingUpgrade Cmdlet Get-AzVmssRollingUpgrade is not contained in Az.Compute.
Az.Compute Microsoft.Compute virtualMachineScaleSets Restart-AzVmss Cmdlet Restart-AzVmss is not contained in Az.Compute.
Az.Compute Microsoft.Compute virtualMachineScaleSets Start-AzVmss Cmdlet Start-AzVmss is not contained in Az.Compute.
Az.Compute Microsoft.Compute virtualMachineScaleSets Start-AzVmssRollingExtensionUpgrade Cmdlet Start-AzVmssRollingExtensionUpgrade is not contained in Az.Compute.
Az.Compute Microsoft.Compute virtualMachineScaleSets Start-AzVmssRollingOSUpgrade Cmdlet Start-AzVmssRollingOSUpgrade is not contained in Az.Compute.
Az.Compute Microsoft.Compute virtualMachineScaleSets Stop-AzVmss Cmdlet Stop-AzVmss is not contained in Az.Compute.
Az.Compute Microsoft.Compute virtualMachineScaleSets Stop-AzVmssRollingUpgrade Cmdlet Stop-AzVmssRollingUpgrade is not contained in Az.Compute.
️✔️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.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

Adds two new Az.Compute cmdlets to read a published Shared VM Extension version and schedule it for graceful deprecation, per the design-reviewed request in the issue.

Cmdlets

  • Get-AzSharedVMExtensionVersion — reads a specific version via -ResourceGroupName/-SharedVMExtensionName/-Version or -ResourceId. The underlying SDK has no List operation, so -Version is mandatory.
  • Set-AzSharedVMExtensionVersionDeprecation — updates -DeprecationState (Active/ScheduledForDeprecation/Deprecated) with optional -DaysUntilDeprecation and -DeprecationType. Supports -ResourceId and pipeline input (-InputObject) from Get-AzSharedVMExtensionVersion. Since the API is PUT-only, the cmdlet fetches the full existing object, mutates only the deprecation status, and resubmits it.

Deprecation state-transition logic

Extracted into a standalone, unit-testable ComputeDeprecationStatus helper:

  • Scheduling for the first time requires -DaysUntilDeprecation (fails fast otherwise).
  • Reactivating (Active) with no overrides clears stale DeprecationTime/DeprecationType.
  • Reactivating with new data requires -DaysUntilDeprecation and -DeprecationType together, avoiding a half-set inconsistent state.
  • Updating an already-scheduled version preserves prior schedule data unless explicitly overridden.
# Schedule deprecation for a published version
Set-AzSharedVMExtensionVersionDeprecation -ResourceGroupName 'myRG' -SharedVMExtensionName 'myExt' -Version '1.0.0' `
  -DeprecationState 'ScheduledForDeprecation' -DaysUntilDeprecation 90 -DeprecationType 'Minor'

# Reactivate, clearing the schedule
Get-AzSharedVMExtensionVersion -ResourceGroupName 'myRG' -SharedVMExtensionName 'myExt' -Version '1.0.0' |
  Set-AzSharedVMExtensionVersionDeprecation -DeprecationState 'Active'

Supporting changes

  • New PSSharedVMExtensionVersion model + AutoMapper mapping, SharedVMExtensionVersionClient accessor on ComputeAutomationBaseCmdlet.
  • Shared ParseSharedVMExtensionVersionResourceId helper to avoid duplicating resource-id parsing across both cmdlets.
  • Help docs, Az.Compute.md/Az.Compute.psd1 registration, and ChangeLog.md entry.
  • Unit tests covering resource-id parsing, SDK-to-PS mapping, and all ComputeDeprecationStatus transition/validation scenarios.

@azure-pipelines

Copy link
Copy Markdown
Contributor
Azure Pipelines:
Successfully started running 2 pipeline(s).
There may be pipelines that require an authorized user to comment /azp run to run.

Co-authored-by: audreyttt <225061541+audreyttt@users.noreply.github.com>
Copilot AI changed the title [WIP] Add Get and schedule deprecation for Shared VM Extension versions commands Add Get-AzSharedVMExtensionVersion and Set-AzSharedVMExtensionVersionDeprecation cmdlets Sep 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants