Repository navigation
[Compute] Add Get-AzSharedVMExtensionVersion and Set-AzSharedVMExtensionVersionDeprecation - #30292
Conversation
Co-authored-by: audreyttt <225061541+audreyttt@users.noreply.github.com>
…tion The -DeprecationType parameter property shadowed the same-named static class Microsoft.Azure.Management.Compute.Models.DeprecationType, so the ValidateSet attribute bound its arguments to the instance property, producing CS0120 and breaking the Compute build (and all downstream Analyze/Help/UX/Test jobs). Fully-qualify the type in ValidateSet. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…validation Set-AzSharedVMExtensionVersionDeprecation now always builds a fresh ExtensionDeprecationStatus from the supplied parameters instead of merging the existing one, and enforces per-state rules: - Active: -DaysUntilDeprecation/-DeprecationType not allowed; status cleared. - ScheduledForDeprecation: both required; DeprecationTime = UtcNow + days. - Deprecated: -DeprecationType required, -DaysUntilDeprecation not allowed; deprecated immediately (DeprecationTime = UtcNow). Updates scenario tests and help accordingly. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
…zSharedVMExtensionVersionDeprecation The cmdlet used this.IsParameterBound(...) without importing Microsoft.WindowsAzure.Commands.Utilities.Common, which defines the extension method. This broke the Compute.csproj build, causing the built Az.Compute module to export no cmdlets and the StaticAnalysis UX Metadata analyzer to report every cmdlet as 'not contained'. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
The TestSharedVMExtensionVersionDeprecation scenario test runs in CI playback mode and requires a committed SessionRecords JSON, which cannot be produced without live Azure access against the 2026-03-03 preview API. This caused all 4 Test legs to fail with 'Unable to find recorded mock file'. Replace it with deterministic unit tests that exercise every validation branch of SetAzSharedVMExtensionVersionDeprecation.ComputeDeprecationStatus directly, with no live calls. The SharedVMExtensionVersionTests.ps1 script is preserved for future live recording. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
| @@ -0,0 +1,205 @@ | |||
| <# | |||
There was a problem hiding this comment.
Please record the newly added test cases.
|
This PR was labeled "needs-revision" because it has unresolved review comments or CI failures. |
X Engineering Agent ReportReview — Comments Upstream CI completed successfully on Upstream CINo failed upstream checks in this snapshot. Test validation
The coverage helper is not applicable to these PowerShell files; that is not proof of scenario execution. Repository policy findings
Risk assessment — 46/100 · MediumThe Medium rating is driven by public CLI behavior, failure-handling behavior, generated output.
Posted by x-engineering-agent (Reviewer) |
🤖 PR Validation — ️✔️ All clear
Description
Adds two new
Az.Computecmdlets for managing Shared VM Extension Version deprecation, plus build-break and business-logic fixes on top of the original work.New cmdlets
Get-AzSharedVMExtensionVersion— GETs a shared VM extension version by resource group + name + version (or by-ResourceId).Set-AzSharedVMExtensionVersionDeprecation— read-modify-write that sets the version'sDeprecationStatus.Fixes / changes in this PR
CS0120build break: fully-qualifiedMicrosoft.Azure.Management.Compute.Models.DeprecationType.*in the[ValidateSet]attribute where theDeprecationTypeparameter name shadowed the static type.Set-AzSharedVMExtensionVersionDeprecationto always build a freshExtensionDeprecationStatusfrom the supplied parameters (instead of merging the existing one), with per-state validation:-DaysUntilDeprecation/-DeprecationTypeare not allowed; status is cleared.-DaysUntilDeprecationand-DeprecationTypeare required;DeprecationTime = UtcNow + days.-DeprecationTypeis required and-DaysUntilDeprecationis not allowed; the version is deprecated immediately (DeprecationTime = UtcNow).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/{{SERVICE}}/{{SERVICE}}/ChangeLog.md.## Upcoming Releaseheader in the past tense.ChangeLog.mdif no new release is required, such as fixing test case only.