-
Notifications
You must be signed in to change notification settings - Fork 3.3k
{Compute} az vm install-patches: Migrate command to aaz-based implementation
#32763
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
{Compute} az vm install-patches: Migrate command to aaz-based implementation
#32763
Conversation
️✔️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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Migrates az vm install-patches from the mgmt-plane azure-mgmt-compute implementation to an AAZ-based implementation within the VM command module.
Changes:
- Replaced the existing
client.begin_install_patches(...)path with a wrapper that invokes the generated AAZInstallPatchescommand. - Updated command registration for
vm install-patchesto no longer require an SDK client factory. - Added VM guest patching enums to
_vm_utils.pyand switched argument enum sources in_params.py.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
src/azure-cli/azure/cli/command_modules/vm/custom.py |
Replaces the SDK-based implementation with an AAZ command invocation wrapper. |
src/azure-cli/azure/cli/command_modules/vm/commands.py |
Re-registers vm install-patches under a command group that doesn’t inject an SDK client. |
src/azure-cli/azure/cli/command_modules/vm/aaz/latest/vm/_install_patches.py |
Adds the generated AAZ command implementation for vm install-patches. |
src/azure-cli/azure/cli/command_modules/vm/aaz/latest/vm/__init__.py |
Exposes the new generated AAZ InstallPatches command via package imports. |
src/azure-cli/azure/cli/command_modules/vm/_vm_utils.py |
Adds local enums for reboot setting and patch classifications. |
src/azure-cli/azure/cli/command_modules/vm/_params.py |
Switches argument enums for vm install-patches to the new local enums. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| from .aaz.latest.vm import Update as UpdateVM | ||
|
|
||
| from .generated.custom import * # noqa: F403, pylint: disable=unused-wildcard-import,wildcard-import | ||
| from ..resource.commands import resource_privatelinksassociation_sdk |
Copilot
AI
Feb 10, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resource_privatelinksassociation_sdk is imported but not used anywhere in this module. This will trigger unused-import linting and adds unnecessary coupling to the resource module; please remove the import (or use it if it was intended).
| from ..resource.commands import resource_privatelinksassociation_sdk |
| with self.command_group('vm') as g: | ||
| g.custom_command('install-patches', 'install_vm_patches', supports_no_wait=True) |
Copilot
AI
Feb 10, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The command registration removed min_api (previously 2020-12-01). Since the new implementation calls the AAZ operation with a fixed Compute api-version (2024-11-01), the command can become available in profiles/clouds that don't support that API version and then fail at runtime. Please add an appropriate min_api gate here (ideally matching the AAZ operation version you are using) to preserve the previous availability behavior.
az vm install-patches: Migrate command to aaz-based implementation
Related command
az vm install-patchesDescription
Migration from mgmt.compute to aaz-based
aaz Azure/aaz#941
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.