Skip to content

{Compute} az vm deallocate: Expose new parameter --force-deallocate - #33855

Open
William (william051200) wants to merge 3 commits into
Azure:devfrom
william051200:force-deallocate
Open

{Compute} az vm deallocate: Expose new parameter --force-deallocate#33855
William (william051200) wants to merge 3 commits into
Azure:devfrom
william051200:force-deallocate

Conversation

@william051200

@william051200 William (william051200) commented Aug 6, 2026

Copy link
Copy Markdown
Member

🤖 PR Validation — ⚠️ Review suggested

Breaking Changes Tests
⚠️ None ️✔️ 130/130
⚠️AzureCLI-BreakingChangeTest
⚠️vm
rule cmd_name rule_message suggest_message
⚠️ 1006 - ParaAdd vm deallocate cmd vm deallocate added parameter force_deallocate

Related command

az vm deallocate

Description

Resolve #33717

Testing Guide

Refer to azure-cli\src\azure-cli\azure\cli\command_modules\vm\tests\latest\test_vm_commands.py - test_vm_force_deallocate test case

History Notes

[Component Name 2] az vm deallocate: Expose new parameter --force-deallocate


This checklist is used to make sure that common guidelines for a pull request are followed.

@william051200
William (william051200) requested a review from a team as a code owner August 6, 2026 02:55
Copilot AI lite review requested due to automatic review settings August 6, 2026 02:55
@azure-pipelines

Copy link
Copy Markdown
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.

Pull request overview

This PR exposes the new --force-deallocate switch for az vm deallocate by stopping the command module from suppressing the underlying AAZ argument, and adds a scenario test + recording to validate the new flag.

Changes:

  • Removes the custom VMDeallocate wrapper that hid the force_deallocate argument from the AAZ vm deallocate command.
  • Stops manually overriding vm deallocate in the command table so the AAZ-registered command (with --force-deallocate) is used.
  • Adds test_vm_force_deallocate and its recorded HTTP interactions.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
src/azure-cli/azure/cli/command_modules/vm/tests/latest/test_vm_commands.py Adds a scenario test covering az vm deallocate --force-deallocate.
src/azure-cli/azure/cli/command_modules/vm/tests/latest/recordings/test_vm_force_deallocate.yaml Adds the recording for the new scenario test.
src/azure-cli/azure/cli/command_modules/vm/operations/vm.py Removes the wrapper class that previously hid the force_deallocate argument.
src/azure-cli/azure/cli/command_modules/vm/commands.py Removes the manual vm deallocate command override so the AAZ command is used.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +1968 to +1970
'--size Standard_D2s_v3', checks=[
self.check('zones', '1'),
])
@yonzhan

Copy link
Copy Markdown
Collaborator

Compute

@william051200

Copy link
Copy Markdown
Member Author

/azp run

@azure-pipelines

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

@a0x1ab Aditya Pujara (a0x1ab) added the agent-assist On-demand trigger for the agent-assist autonomous bug-fix pipeline label Aug 6, 2026
@william051200

Copy link
Copy Markdown
Member Author

/azp run

@azure-pipelines

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

@a0x1ab Aditya Pujara (a0x1ab) added azure-client-tools-agent Pull request commented on or reviewed by Azure Client Tools Agent and removed agent-assist On-demand trigger for the agent-assist autonomous bug-fix pipeline labels Aug 6, 2026
@a0x1ab Aditya Pujara (a0x1ab) removed the azure-client-tools-agent Pull request commented on or reviewed by Azure Client Tools Agent label Aug 6, 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.

Feature Request - ForceDeallocate flag with exisiting "az vm deallocate"

5 participants