{Compute} az vmss stop: Migrate command to aaz-based implementation#32799
{Compute} az vmss stop: Migrate command to aaz-based implementation#32799william051200 wants to merge 2 commits intoAzure:devfrom
az vmss stop: Migrate command to aaz-based implementation#32799Conversation
️✔️AzureCLI-FullTest
|
|
Thank you for your contribution! We will review the pull request and get back to you soon. |
|
Hi @william051200, |
|
The git hooks are available for azure-cli and azure-cli-extensions repos. They could help you run required checks before creating the PR. Please sync the latest code with latest dev branch (for azure-cli) or main branch (for azure-cli-extensions). pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>
|
️✔️AzureCLI-BreakingChangeTest
|
There was a problem hiding this comment.
Pull request overview
Migrates az vmss stop from the legacy mgmt.compute SDK invocation path to an AAZ-based implementation within the vm command module.
Changes:
- Reimplemented
stop_vmssincustom.pyto invoke the generated AAZvmss Stopcommand. - Re-registered
vmss stopincommands.pyunder the non-SDKvmsscommand group. - Added a new generated AAZ operation implementation for VMSS stop (
aaz/latest/vmss/_stop.py) and exported it via the VMSS AAZ package__init__.py.
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/custom.py |
Switches stop_vmss to call AAZ Stop with command_args. |
src/azure-cli/azure/cli/command_modules/vm/commands.py |
Moves vmss stop registration to the non-SDK vmss group. |
src/azure-cli/azure/cli/command_modules/vm/aaz/latest/vmss/_stop.py |
Introduces generated AAZ HTTP operation for VMSS power off. |
src/azure-cli/azure/cli/command_modules/vm/aaz/latest/vmss/__init__.py |
Exposes the new _stop module. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if instance_ids: | ||
| command_args['instance_ids'] = instance_ids |
There was a problem hiding this comment.
This changes the default request body for az vmss stop when --instance-ids is omitted: previously the SDK call always sent instanceIds=['*'] (see existing test recordings), but this new implementation omits instance_ids entirely. That will break current recorded tests/playback and may be a behavioral change vs the existing CLI contract. Consider preserving the previous default by setting instance_ids=['*'] when instance_ids is None, or update/re-record the affected vmss stop recordings to match the new payload shape.
| if instance_ids: | |
| command_args['instance_ids'] = instance_ids | |
| # Preserve legacy behavior: when --instance-ids is omitted, default to all instances ['*'] | |
| if instance_ids is None: | |
| instance_ids = ['*'] | |
| command_args['instance_ids'] = instance_ids |
Related command
az vmss stopDescription
Migration from mgmt.compute to aaz-based
aaz Azure/aaz#948
Testing Guide
History Notes
This 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.