-
Notifications
You must be signed in to change notification settings - Fork 3.3k
{Compute} az vm user: Migrate to aaz
#32118
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
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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) |
Copilot
AI
Sep 16, 2025
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.
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) |
Copilot
AI
Sep 16, 2025
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.
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) |
Copilot
AI
Sep 16, 2025
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.
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) |
Copilot
AI
Sep 16, 2025
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.
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.