{Compute} az vm user: Migrate to aaz#32118
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>
|
d7af431 to
94190a1
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR migrates the az vm user command group from SDK-based implementation to Azure AutoRest for Azure CLI (AAZ) framework. The migration introduces new AAZ-compatible helper functions and updates the existing VM user management functions to use AAZ operations instead of direct SDK calls.
- Migrates VM user management commands from SDK to AAZ framework
- Updates test cases to use appropriate VM sizes for testing environments
- Replaces direct SDK client calls with AAZ operation classes
Reviewed Changes
Copilot reviewed 2 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| src/azure-cli/azure/cli/command_modules/vm/custom.py | Migrates VM user management functions to use AAZ operations and adds AAZ-compatible helper functions |
| src/azure-cli/azure/cli/command_modules/vm/tests/latest/test_vm_commands.py | Updates test cases to use Standard_B2s and Standard_B2ms VM sizes instead of previous sizes |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| poller = _update_linux_access_extension(cmd, vm_instance, resource_group_name, | ||
| protected_settings) | ||
| return ExtensionUpdateLongRunningOperation(cmd.cli_ctx, 'setting user', 'done')(poller) | ||
| return LongRunningOperation(cmd.cli_ctx, 'setting user', 'done')(poller) |
There was a problem hiding this comment.
Missing import for LongRunningOperation. The code is using LongRunningOperation but there's no import statement visible, while the previous ExtensionUpdateLongRunningOperation import was removed.
| return ExtensionUpdateLongRunningOperation(cmd.cli_ctx, 'resetting admin', 'done')(poller) | ||
| return poller | ||
|
|
||
| return LongRunningOperation(cmd.cli_ctx, 'resetting admin', 'done')(poller) |
There was a problem hiding this comment.
Missing import for LongRunningOperation. The code is using LongRunningOperation but there's no import statement visible, while the previous ExtensionUpdateLongRunningOperation import was removed.
| poller = _update_linux_access_extension(cmd, vm, resource_group_name, | ||
| {'remove_user': username}) | ||
| return ExtensionUpdateLongRunningOperation(cmd.cli_ctx, 'deleting user', 'done')(poller) | ||
| return LongRunningOperation(cmd.cli_ctx, 'deleting user', 'done')(poller) |
There was a problem hiding this comment.
Missing import for LongRunningOperation. The code is using LongRunningOperation but there's no import statement visible, while the previous ExtensionUpdateLongRunningOperation import was removed.
| poller = _update_linux_access_extension(cmd, vm, resource_group_name, | ||
| {'reset_ssh': True}) | ||
| return ExtensionUpdateLongRunningOperation(cmd.cli_ctx, 'resetting SSH', 'done')(poller) | ||
| return LongRunningOperation(cmd.cli_ctx, 'resetting SSH', 'done')(poller) |
There was a problem hiding this comment.
Missing import for LongRunningOperation. The code is using LongRunningOperation but there's no import statement visible, while the previous ExtensionUpdateLongRunningOperation import was removed.
Co-authored-by: Yan Zhu <105691024+yanzhudd@users.noreply.github.com>
Co-authored-by: Yan Zhu <105691024+yanzhudd@users.noreply.github.com>
Related command
az vm user delete/reset-ssh/updateDescription
Migrate the command group.
No aaz repo changes.
Testing Guide
History Notes
[Component Name 1] BREAKING CHANGE:
az command a: Make some customer-facing breaking change[Component Name 2]
az command b: Add some customer-facing featureThis 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.