Skip to content

{Compute} az vm run-command: Migrate to AAZ#32026

Merged
yanzhudd merged 3 commits intoAzure:devfrom
cxznmhdcxz:vm-run-command-migrate
Sep 16, 2025
Merged

{Compute} az vm run-command: Migrate to AAZ#32026
yanzhudd merged 3 commits intoAzure:devfrom
cxznmhdcxz:vm-run-command-migrate

Conversation

@cxznmhdcxz
Copy link
Copy Markdown
Member

@cxznmhdcxz cxznmhdcxz commented Aug 29, 2025

Related command

az vm run-command create/delete/list/show/update/invoke

Description

Migrate to AAZ
Azure/aaz#845

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 feature


This checklist is used to make sure that common guidelines for a pull request are followed.

@azure-client-tools-bot-prd
Copy link
Copy Markdown

azure-client-tools-bot-prd bot commented Aug 29, 2025

️✔️AzureCLI-FullTest
️✔️acr
️✔️latest
️✔️3.12
️✔️3.13
️✔️acs
️✔️latest
️✔️3.12
️✔️3.13
️✔️advisor
️✔️latest
️✔️3.12
️✔️3.13
️✔️ams
️✔️latest
️✔️3.12
️✔️3.13
️✔️apim
️✔️latest
️✔️3.12
️✔️3.13
️✔️appconfig
️✔️latest
️✔️3.12
️✔️3.13
️✔️appservice
️✔️latest
️✔️3.12
️✔️3.13
️✔️aro
️✔️latest
️✔️3.12
️✔️3.13
️✔️backup
️✔️latest
️✔️3.12
️✔️3.13
️✔️batch
️✔️latest
️✔️3.12
️✔️3.13
️✔️batchai
️✔️latest
️✔️3.12
️✔️3.13
️✔️billing
️✔️latest
️✔️3.12
️✔️3.13
️✔️botservice
️✔️latest
️✔️3.12
️✔️3.13
️✔️cdn
️✔️latest
️✔️3.12
️✔️3.13
️✔️cloud
️✔️latest
️✔️3.12
️✔️3.13
️✔️cognitiveservices
️✔️latest
️✔️3.12
️✔️3.13
️✔️compute_recommender
️✔️latest
️✔️3.12
️✔️3.13
️✔️computefleet
️✔️latest
️✔️3.12
️✔️3.13
️✔️config
️✔️latest
️✔️3.12
️✔️3.13
️✔️configure
️✔️latest
️✔️3.12
️✔️3.13
️✔️consumption
️✔️latest
️✔️3.12
️✔️3.13
️✔️container
️✔️latest
️✔️3.12
️✔️3.13
️✔️containerapp
️✔️latest
️✔️3.12
️✔️3.13
️✔️core
️✔️latest
️✔️3.12
️✔️3.13
️✔️cosmosdb
️✔️latest
️✔️3.12
️✔️3.13
️✔️databoxedge
️✔️latest
️✔️3.12
️✔️3.13
️✔️dls
️✔️latest
️✔️3.12
️✔️3.13
️✔️dms
️✔️latest
️✔️3.12
️✔️3.13
️✔️eventgrid
️✔️latest
️✔️3.12
️✔️3.13
️✔️eventhubs
️✔️latest
️✔️3.12
️✔️3.13
️✔️feedback
️✔️latest
️✔️3.12
️✔️3.13
️✔️find
️✔️latest
️✔️3.12
️✔️3.13
️✔️hdinsight
️✔️latest
️✔️3.12
️✔️3.13
️✔️identity
️✔️latest
️✔️3.12
️✔️3.13
️✔️iot
️✔️latest
️✔️3.12
️✔️3.13
️✔️keyvault
️✔️latest
️✔️3.12
️✔️3.13
️✔️lab
️✔️latest
️✔️3.12
️✔️3.13
️✔️managedservices
️✔️latest
️✔️3.12
️✔️3.13
️✔️maps
️✔️latest
️✔️3.12
️✔️3.13
️✔️marketplaceordering
️✔️latest
️✔️3.12
️✔️3.13
️✔️monitor
️✔️latest
️✔️3.12
️✔️3.13
️✔️mysql
️✔️latest
️✔️3.12
️✔️3.13
️✔️netappfiles
️✔️latest
️✔️3.12
️✔️3.13
️✔️network
️✔️latest
️✔️3.12
️✔️3.13
️✔️policyinsights
️✔️latest
️✔️3.12
️✔️3.13
️✔️privatedns
️✔️latest
️✔️3.12
️✔️3.13
️✔️profile
️✔️latest
️✔️3.12
️✔️3.13
️✔️rdbms
️✔️latest
️✔️3.12
️✔️3.13
️✔️redis
️✔️latest
️✔️3.12
️✔️3.13
️✔️relay
️✔️latest
️✔️3.12
️✔️3.13
️✔️resource
️✔️latest
️✔️3.12
️✔️3.13
️✔️role
️✔️latest
️✔️3.12
️✔️3.13
️✔️search
️✔️latest
️✔️3.12
️✔️3.13
️✔️security
️✔️latest
️✔️3.12
️✔️3.13
️✔️servicebus
️✔️latest
️✔️3.12
️✔️3.13
️✔️serviceconnector
️✔️latest
️✔️3.12
️✔️3.13
️✔️servicefabric
️✔️latest
️✔️3.12
️✔️3.13
️✔️signalr
️✔️latest
️✔️3.12
️✔️3.13
️✔️sql
️✔️latest
️✔️3.12
️✔️3.13
️✔️sqlvm
️✔️latest
️✔️3.12
️✔️3.13
️✔️storage
️✔️latest
️✔️3.12
️✔️3.13
️✔️synapse
️✔️latest
️✔️3.12
️✔️3.13
️✔️telemetry
️✔️latest
️✔️3.12
️✔️3.13
️✔️util
️✔️latest
️✔️3.12
️✔️3.13
️✔️vm
️✔️latest
️✔️3.12
️✔️3.13

@azure-client-tools-bot-prd
Copy link
Copy Markdown

azure-client-tools-bot-prd bot commented Aug 29, 2025

⚠️AzureCLI-BreakingChangeTest
⚠️vm
rule cmd_name rule_message suggest_message
⚠️ 1004 - CmdPropRemove vm run-command delete cmd vm run-command delete removed property confirmation
⚠️ 1008 - ParaPropAdd vm run-command delete cmd vm run-command delete update parameter no_wait: added property aaz_type=bool
⚠️ 1008 - ParaPropAdd vm run-command delete cmd vm run-command delete update parameter no_wait: added property choices=['0', '1', 'f', 'false', 'n', 'no', 't', 'true', 'y', 'yes']
⚠️ 1008 - ParaPropAdd vm run-command delete cmd vm run-command delete update parameter no_wait: added property nargs=?
⚠️ 1008 - ParaPropAdd vm run-command delete cmd vm run-command delete update parameter no_wait: added property type=bool
⚠️ 1008 - ParaPropAdd vm run-command delete cmd vm run-command delete update parameter resource_group_name: added property aaz_type=string
⚠️ 1008 - ParaPropAdd vm run-command delete cmd vm run-command delete update parameter resource_group_name: added property type=string
⚠️ 1010 - ParaPropUpdate vm run-command delete cmd vm run-command delete update parameter resource_group_name: updated property name from resource_group_name to resource_group
⚠️ 1008 - ParaPropAdd vm run-command delete cmd vm run-command delete update parameter run_command_name: added property aaz_type=string
⚠️ 1008 - ParaPropAdd vm run-command delete cmd vm run-command delete update parameter run_command_name: added property id_part=child_name_1
⚠️ 1008 - ParaPropAdd vm run-command delete cmd vm run-command delete update parameter run_command_name: added property type=string
⚠️ 1010 - ParaPropUpdate vm run-command delete cmd vm run-command delete update parameter run_command_name: updated property options from ['--name', '--run-command-name'] to ['--name', '--run-command-name', '-n']
⚠️ 1008 - ParaPropAdd vm run-command delete cmd vm run-command delete update parameter vm_name: added property aaz_type=string
⚠️ 1008 - ParaPropAdd vm run-command delete cmd vm run-command delete update parameter vm_name: added property type=string

@yonzhan
Copy link
Copy Markdown
Collaborator

yonzhan commented Aug 29, 2025

Thank you for your contribution! We will review the pull request and get back to you soon.

@github-actions
Copy link
Copy Markdown

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).
After that please run the following commands to enable git hooks:

pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>

@microsoft-github-policy-service microsoft-github-policy-service bot added the Auto-Assign Auto assign by bot label Aug 29, 2025
@microsoft-github-policy-service microsoft-github-policy-service bot added the Compute az vm/vmss/image/disk/snapshot label Aug 29, 2025
@cxznmhdcxz cxznmhdcxz marked this pull request as ready for review August 29, 2025 08:04
Copilot AI review requested due to automatic review settings August 29, 2025 08:04
Copy link
Copy Markdown
Contributor

Copilot AI left a 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 run-command commands from SDK-based implementation to the AAZ (Azure CLI Command Framework) pattern. The migration aims to modernize the command structure and improve maintainability.

  • Replaces manual SDK client usage with auto-generated AAZ commands
  • Updates test configurations to use newer VM images and larger instance sizes
  • Removes obsolete client factory and import dependencies

Reviewed Changes

Copilot reviewed 15 out of 17 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/azure-cli/azure/cli/command_modules/vm/custom.py Migrates all run-command functions to use AAZ commands instead of SDK clients
src/azure-cli/azure/cli/command_modules/vm/commands.py Updates command registration to remove SDK client factory dependency
src/azure-cli/azure/cli/command_modules/vm/_client_factory.py Removes obsolete cf_run_commands factory function
src/azure-cli/azure/cli/command_modules/vm/tests/latest/test_vm_commands.py Updates test VM configurations with newer images and larger instance sizes
src/azure-cli/azure/cli/command_modules/vm/aaz/latest/vm/run_command/*.py Adds auto-generated AAZ command implementations for all run-command operations

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread src/azure-cli/azure/cli/command_modules/vm/custom.py Outdated
run_command_name=run_command_name,
run_command=run_command)
args['error_blob_uri'] = error_blob_uri
return LongRunningOperation(cmd.cli_ctx)(Create(cli_ctx=cmd.cli_ctx)(command_args=args))
Copy link

Copilot AI Aug 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing import statement for LongRunningOperation. This will cause a runtime error when the function is called.

Copilot uses AI. Check for mistakes.
args['run_command_name'] = run_command_name
args['vm_name'] = vm_name
args['no_wait'] = no_wait
return LongRunningOperation(cmd.cli_ctx)(Update(cli_ctx=cmd.cli_ctx)(command_args=args))
Copy link

Copilot AI Aug 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing import statement for LongRunningOperation. This will cause a runtime error when the function is called.

Copilot uses AI. Check for mistakes.
@cxznmhdcxz cxznmhdcxz marked this pull request as draft August 29, 2025 09:10
@cxznmhdcxz cxznmhdcxz force-pushed the vm-run-command-migrate branch from 9bb1ac1 to c6b5600 Compare August 29, 2025 09:14
@cxznmhdcxz cxznmhdcxz force-pushed the vm-run-command-migrate branch from c6b5600 to ac286ec Compare September 1, 2025 03:20
@cxznmhdcxz cxznmhdcxz marked this pull request as ready for review September 1, 2025 05:44
@yanzhudd
Copy link
Copy Markdown
Contributor

yanzhudd commented Sep 2, 2025

please fix the CI issues.

@cxznmhdcxz cxznmhdcxz force-pushed the vm-run-command-migrate branch from 14f0abe to ac03922 Compare September 3, 2025 08:15
@yanzhudd
Copy link
Copy Markdown
Contributor

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 3 pipeline(s).

Comment thread src/azure-cli/azure/cli/command_modules/vm/custom.py Outdated
@yanzhudd yanzhudd merged commit 2ced00c into Azure:dev Sep 16, 2025
48 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Auto-Assign Auto assign by bot Compute az vm/vmss/image/disk/snapshot

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants