{Compute} az vmss application: Migrate command group to aaz-based implementation#32783
{Compute} az vmss application: Migrate command group to aaz-based implementation#32783william051200 wants to merge 3 commits intoAzure:devfrom
az vmss application: Migrate command group to aaz-based implementation#32783Conversation
️✔️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.
Pull request overview
Migrates the az vmss application command group to an AAZ-based implementation as part of the broader mgmt-plane → AAZ transition in the VM command module.
Changes:
- Update
vmss application listto retrieve VMSS data via AAZShowand returnapplicationProfilefrom the result. - Register
vmss application set/listunder a dedicatedvmss applicationcommand group instead of as subcommands ofvmss.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
src/azure-cli/azure/cli/command_modules/vm/custom.py |
Switch VMSS application listing to AAZ-based VMSS show output parsing. |
src/azure-cli/azure/cli/command_modules/vm/commands.py |
Move vmss application command registrations into a dedicated command group. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| from .aaz.latest.vmss import Show as VmssShow | ||
| try: | ||
| vmss = client.virtual_machine_scale_sets.get(resource_group_name, vmss_name) | ||
| command_args = { | ||
| 'resource_group': resource_group_name, | ||
| 'vm_scale_set_name': vmss_name | ||
| } | ||
| vmss = VmssShow(cli_ctx=cmd.cli_ctx)(command_args=command_args) |
There was a problem hiding this comment.
Use the operations.vmss.VMSSShow wrapper (or the existing get_vmss_by_aaz helper) instead of importing Show directly from .aaz.latest.vmss. The wrapper applies the standard VMSS show output normalization (e.g., resolves known flatten conflicts) and is already the pattern used elsewhere in this module for VMSS AAZ reads.
| except ResourceNotFoundError: | ||
| raise ResourceNotFoundError('Could not find vmss {}.'.format(vmss_name)) | ||
| return vmss.virtual_machine_profile.application_profile | ||
| return vmss.get('virtualMachineProfile', {}).get('applicationProfile') |
There was a problem hiding this comment.
list_vm_applications returns an empty object when applicationProfile is missing, but this returns None when applicationProfile is absent. Consider defaulting to {} here as well to keep vm application list and vmss application list output shapes consistent and avoid emitting null.
| return vmss.get('virtualMachineProfile', {}).get('applicationProfile') | |
| return vmss.get('virtualMachineProfile', {}).get('applicationProfile', {}) |
Related command
az vmss application setaz vmss application listDescription
Migration from mgmt.compute to aaz-based
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.