Skip to content

Az.Compute: add Set-AzVMZoneMovement and wire ResiliencyProfile persistence for VM create/update - #29889

Draft
haagha with Copilot wants to merge 2 commits into
mainfrom
copilot/az-compute-zone-movement
Draft

Az.Compute: add Set-AzVMZoneMovement and wire ResiliencyProfile persistence for VM create/update#29889
haagha with Copilot wants to merge 2 commits into
mainfrom
copilot/az-compute-zone-movement

Conversation

Copilot AI commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

This change introduces Set-AzVMZoneMovement in Az.Compute to let customers toggle VM zone movement on a PSVirtualMachine model, then persist it with Update-AzVM. It also ensures the ResiliencyProfile payload is carried through VM create/update flows so the setting is sent to Compute RP.

  • Cmdlet surface

    • Added new cmdlet: Set-AzVMZoneMovement
    • Signature:
      • -VM <PSVirtualMachine> (mandatory, pipeline-enabled)
      • -IsEnabled <Boolean> (mandatory)
    • Behavior:
      • Initializes VM.ResiliencyProfile when null
      • Initializes VM.ResiliencyProfile.ZoneMovement when null
      • Sets ZoneMovement.IsEnabled to the requested value
  • Model + request wiring

    • Added ResiliencyProfile to PSVirtualMachine
    • Updated VM request construction paths to include ResiliencyProfile in:
      • New-AzVM flow
      • Update-AzVM flow
  • Documentation + module registration

    • Added help file: Set-AzVMZoneMovement.md
    • Added cmdlet entry to Az.Compute.md (module landing page)
    • Registered cmdlet export in Az.Compute.psd1
  • Scenario coverage

    • Added profile-level scenario coverage for:
      • enable ($true) and disable ($false) transitions
      • nested object initialization behavior
      • null-input negative case
    • Wired the new scenario function into the corresponding C# [Fact] check-in test
$vm = Get-AzVM -ResourceGroupName "rg1" -Name "myVM"
$vm = Set-AzVMZoneMovement -VM $vm -IsEnabled $true
Update-AzVM -ResourceGroupName "rg1" -VM $vm

Verification Checklist

  • Cmdlet implementation updated with the new/changed parameter(s)
  • Model class updated to represent the API schema.
  • Help content regenerated: new parameter appears in the SYNTAX section and in alphabetical order in the PARAMETERS section.
  • Examples updated to cover the new parameter(s).
  • If adding a new command, add it to the help/Az.Compute.md file
  • If adding a new command, register it in Az.Compute.psd1 (CmdletsToExport, alphabetical order).
  • New scenario tests cover the full matrix: each new parameter exercised alone and in combination (may share a single test), every affected cmdlet, Update merge semantics, removal/disable paths, and negative/edge cases (mutually exclusive params; $null/empty inputs validated per [ValidateNotNullOrEmpty] or other validation attributes).
  • Test assertions check concrete sub-properties (type/enum, collection counts and membership, computed fields) and re-read the resource with a follow-up Get-* call to confirm the values persisted.
  • Every new .ps1 scenario function is wired into the .cs file as a [Fact] check-in test.
  • ChangeLog.md updated with a concise, user-focused entry under ## Upcoming Release.

Copilot AI requested review from Copilot and removed request for Copilot July 23, 2026 16: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 requested review from Copilot and removed request for Copilot July 23, 2026 16:30
Copilot AI changed the title [WIP] Add cmdlets for Azure Compute ZoneMovement Az.Compute: add Set-AzVMZoneMovement and wire ResiliencyProfile persistence for VM create/update Jul 23, 2026
Copilot AI requested a review from haagha July 23, 2026 16:31
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