{Compute} az vm restart: Migrate command to aaz-based implementation#32778
{Compute} az vm restart: Migrate command to aaz-based implementation#32778william051200 wants to merge 4 commits intoAzure:devfrom
az vm restart: Migrate command to aaz-based implementation#32778Conversation
️✔️AzureCLI-FullTest
|
️✔️AzureCLI-BreakingChangeTest
|
|
Thank you for your contribution! We will review the pull request and get back to you soon. |
|
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>
|
There was a problem hiding this comment.
Pull request overview
Migrates az vm restart from the legacy azure-mgmt-compute SDK call path to an AAZ-based implementation within the VM command module.
Changes:
- Updated
restart_vmto invoke AAZ-generatedRestart/Redeployoperations (keeping--forcebehavior via redeploy). - Adjusted command registration location for
vm restartin the command table. - Added the AAZ-generated implementation for the
vm restartoperation and exported it from the AAZ VM package.
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 restart_vm to call AAZ Restart/Redeploy instead of mgmt SDK LROs. |
src/azure-cli/azure/cli/command_modules/vm/commands.py |
Moves vm restart registration to a separate vm command_group block. |
src/azure-cli/azure/cli/command_modules/vm/aaz/latest/vm/_restart.py |
Introduces the generated AAZ command/operation for vm restart. |
src/azure-cli/azure/cli/command_modules/vm/aaz/latest/vm/__init__.py |
Exposes the new _restart module via package imports. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| with self.command_group('vm') as g: | ||
| g.custom_command('restart', 'restart_vm', supports_no_wait=True) | ||
|
|
There was a problem hiding this comment.
The vm command group is opened twice with the same compute_vm_sdk just to register restart. This is redundant and makes the command table harder to follow/maintain. Consider registering restart within the existing with self.command_group('vm', compute_vm_sdk) as g: block above instead of creating a separate block.
Related command
az vm restartDescription
Migration from mgmt.compute to aaz-based
aaz Azure/aaz#943
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.