{Compute} az sshkey: Migrate command group to aaz-based implementation - #34125
Open
William (william051200) wants to merge 8 commits into
Open
William (william051200) wants to merge 8 commits into
William (william051200) wants to merge 8 commits into
Conversation
|
Hi William (@william051200), |
Copilot started reviewing on behalf of
William (william051200)
September 24, 2026 03:07
View session
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Preserve generic update options and write private keys with restrictive permissions.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 1
Open (1)
What changed in this PR
Migrates az sshkey CRUD commands to AAZ while preserving custom key-pair generation and preventing legacy loader overwrites.
Changes:
- Adds AAZ SSH key commands and registrations.
- Adds custom key generation and persistence.
- Updates command loading and scenario tests.
| File | Description |
|---|---|
src/azure-cli/azure/cli/command_modules/vm/tests/latest/test_vm_commands.py |
Updates SSH key scenario coverage. |
src/azure-cli/azure/cli/command_modules/vm/operations/sshkey.py |
Implements custom creation and key-pair persistence. |
src/azure-cli/azure/cli/command_modules/vm/commands.py |
Registers the custom create command. |
src/azure-cli/azure/cli/command_modules/vm/aaz/latest/sshkey/_update.py |
Provides the AAZ update operation. |
src/azure-cli/azure/cli/command_modules/vm/aaz/latest/sshkey/_show.py |
Provides the AAZ show operation. |
src/azure-cli/azure/cli/command_modules/vm/aaz/latest/sshkey/_list.py |
Provides the AAZ list operation. |
src/azure-cli/azure/cli/command_modules/vm/aaz/latest/sshkey/_generate_key_pair.py |
Provides key-pair generation. |
src/azure-cli/azure/cli/command_modules/vm/aaz/latest/sshkey/_delete.py |
Provides the AAZ delete operation. |
src/azure-cli/azure/cli/command_modules/vm/aaz/latest/sshkey/_create.py |
Provides the AAZ create operation. |
src/azure-cli/azure/cli/command_modules/vm/aaz/latest/sshkey/__init__.py |
Initializes SSH key commands. |
src/azure-cli/azure/cli/command_modules/vm/aaz/latest/sshkey/__cmd_group.py |
Registers the SSH key command group. |
src/azure-cli/azure/cli/command_modules/vm/__init__.py |
Prevents legacy loaders from overwriting generated commands. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| private_key_file = str(ssh_path.joinpath(str(time.time()).replace(".", "_"))) | ||
| public_key_file = private_key_file + ".pub" | ||
|
|
||
| with open(private_key_file, "w", newline="\n") as file: |
Collaborator
|
Compute |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

🤖 PR Validation —⚠️ Review suggested
Related command
az sshkey create/list/show/update/deleteDescription
Updated
src/azure-cli/azure/cli/command_modules/vm/__init__.pyto prevent overwriting from generated & manual code.Migration from mgmt.compute to aaz-based
aaz Azure/aaz#1104
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.