{Compute} az vm deallocate: Expose new parameter --force-deallocate - #33855
Open
William (william051200) wants to merge 3 commits into
Open
{Compute} az vm deallocate: Expose new parameter --force-deallocate#33855William (william051200) wants to merge 3 commits into
az vm deallocate: Expose new parameter --force-deallocate#33855William (william051200) wants to merge 3 commits into
Conversation
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
microsoft-github-policy-service
Bot
requested review from
Julie Zhu (yanzhudd) and
Yong Zhang (yonzhan)
August 6, 2026 02:55
Contributor
There was a problem hiding this comment.
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
VMDeallocatewrapper that hid theforce_deallocateargument from the AAZvm deallocatecommand. - Stops manually overriding
vm deallocatein the command table so the AAZ-registered command (with--force-deallocate) is used. - Adds
test_vm_force_deallocateand 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'), | ||
| ]) |
Collaborator
|
Compute |
Member
Author
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
Member
Author
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 PR Validation —⚠️ Review suggested
Related command
az vm deallocateDescription
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_deallocatetest caseHistory Notes
[Component Name 2]
az vm deallocate: Expose new parameter--force-deallocateThis checklist is used to make sure that common guidelines for a pull request are followed.
The PR title and description has followed the guideline in Submitting Pull Requests.
I adhere to the Command Guidelines.
I adhere to the Error Handling Guidelines.