-
Notifications
You must be signed in to change notification settings - Fork 3.3k
{Compute} az vm attach/detach: Migrate commands to aaz #32651
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>
|
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 disk attach and az vm disk detach commands from hand-written SDK code to AAZ (Azure AutoRest CLI)-generated operations. The migration modernizes the codebase by leveraging automatically generated API clients while preserving the command functionality.
Changes:
- Refactored
attach_managed_data_diskto use AAZ operations (AttachDetachDataDisk for fast path, VMCreate for complex scenarios) - Refactored
detach_managed_data_diskto use AAZ operations (VMShow and AttachDetachDataDisk) - Added
safe_getutility function for safe nested dictionary access
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 14 comments.
| File | Description |
|---|---|
| src/azure-cli/azure/cli/command_modules/vm/custom.py | Migrated attach and detach disk functions to use AAZ-generated operations instead of hand-written SDK code |
| src/azure-cli/azure/cli/command_modules/vm/_vm_utils.py | Added safe_get utility function for safe nested dictionary/list traversal |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
redundant pr |
Related command
az vm disk attachaz vm disk detachDescription
Testing Guide
Migrate
az vm disk attachandaz vm disk detachcommands from hand written sdk to aaz.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.