-
Notifications
You must be signed in to change notification settings - Fork 3.3k
{Compute} Add resiliency view command and argument #32496
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
|
|
| rule | cmd_name | rule_message | suggest_message |
|---|---|---|---|
| vmss get-resiliency-view | cmd vmss get-resiliency-view added |
||
| vmss list-instances | cmd vmss list-instances added parameter resiliency_view |
||
| vmss list-instances | cmd vmss list-instances update parameter expand: removed property aaz_type=string |
||
| vmss list-instances | cmd vmss list-instances update parameter expand: removed property type=string |
||
| vmss list-instances | cmd vmss list-instances update parameter filter: removed property aaz_type=string |
||
| vmss list-instances | cmd vmss list-instances update parameter filter: removed property type=string |
||
| vmss list-instances | cmd vmss list-instances update parameter pagination_limit: removed property aaz_type=int |
||
| vmss list-instances | cmd vmss list-instances update parameter pagination_token: removed property aaz_type=string |
||
| vmss list-instances | cmd vmss list-instances update parameter pagination_token: removed property type=string |
||
| vmss list-instances | cmd vmss list-instances update parameter resource_group: removed property aaz_type=string |
||
| vmss list-instances | cmd vmss list-instances update parameter resource_group: removed property type=string |
||
| vmss list-instances | cmd vmss list-instances update parameter resource_group: updated property name from resource_group to resource_group_name |
||
| vmss list-instances | cmd vmss list-instances update parameter select: removed property aaz_type=string |
||
| vmss list-instances | cmd vmss list-instances update parameter select: removed property type=string |
||
| vmss list-instances | cmd vmss list-instances update parameter virtual_machine_scale_set_name: added property id_part=virtual_machine_scale_set_name |
||
| vmss list-instances | cmd vmss list-instances update parameter virtual_machine_scale_set_name: removed property aaz_type=string |
||
| vmss list-instances | cmd vmss list-instances update parameter virtual_machine_scale_set_name: removed property type=string |
|
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 adds resiliency view functionality to Azure CLI VMSS commands, enabling users to view the resiliency status of virtual machine scale set instances through two new commands: az vmss get-resiliency-view and az vmss list-instances --resiliency-view.
Key Changes
- Added
VMSSGetResiliencyViewcommand class that extends_VMSSVMSShowto retrieve resiliency status for a specific VMSS instance - Implemented
get_instances_listfunction to list all VMSS instances with optional resiliency view data - Updated command registration to expose the new commands
- Added comprehensive test coverage for both Flexible and Uniform orchestration modes
Reviewed changes
Copilot reviewed 4 out of 5 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/operations/vmss_vms.py | Implements the new VMSSGetResiliencyView command class with resiliencyView expansion |
| src/azure-cli/azure/cli/command_modules/vm/custom.py | Adds get_instances_list function with resiliency view support |
| src/azure-cli/azure/cli/command_modules/vm/commands.py | Registers new commands in the command table |
| src/azure-cli/azure/cli/command_modules/vm/tests/latest/test_vm_commands.py | Adds test case covering both Flexible and Uniform VMSS orchestration modes |
| src/azure-cli/azure/cli/command_modules/vm/tests/latest/recordings/test_vmss_resiliency_view.yaml | Test recording file for the new test |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # the urlopen is imported for automation purpose | ||
| from urllib.request import urlopen # noqa, pylint: disable=import-error,unused-import,ungrouped-imports | ||
|
|
||
| from azdev.operations.statistics import command_args_express |
Copilot
AI
Dec 4, 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.
This import appears to be incorrect. command_args_express from azdev.operations.statistics doesn't seem to be used anywhere in the file and shouldn't be imported from azdev (which is a development tool package) in production code.
| from azdev.operations.statistics import command_args_express |
| return args_schema | ||
|
|
||
| def pre_operations(self): | ||
| self.ctx.args.expand='resiliencyView' |
Copilot
AI
Dec 4, 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 space after = in the assignment. Should be self.ctx.args.expand = 'resiliencyView' to follow PEP 8 style guidelines.
| self.ctx.args.expand='resiliencyView' | |
| self.ctx.args.expand = 'resiliencyView' |
|
|
||
| instances_id = [instance['instanceId'] for instance in instance_list] | ||
| self.kwargs['instance_id'] = instances_id[0] | ||
|
|
Copilot
AI
Dec 4, 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.
Trailing whitespace on empty line. This should be removed.
|
please refer to the error of breaking-change detector: since you have changed the implementation logic from aaz inheritance to wrapper, you need to make sure this change won't introduce any breaking change. azure-cli/src/azure-cli/azure/cli/command_modules/vm/aaz/latest/vmss/_list_instances.py Line 39 in e39ecb4
|
| with self.argument_context('vmss list-instances') as c: | ||
| c.argument('virtual_machine_scale_set_name', id_part='virtual_machine_scale_set_name', required=True, options_list=["-n", "--name", "--virtual-machine-scale-set-name"], | ||
| help='The name of the VM scale set.') | ||
| c.argument('expand', options_list=['--expand'], help="The expand expression to apply to the operation. Allowed values are 'instanceView'.") |
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.
you don't need to specify the option list if the parameter name is exactly the same as agument name
| c.argument('expand', options_list=['--expand'], help="The expand expression to apply to the operation. Allowed values are 'instanceView'.") | |
| c.argument('expand', help="The expand expression to apply to the operation. Allowed values are 'instanceView'.") |
| help="The filter to apply to the operation. Allowed values are 'startswith(instanceView/statuses/code, 'PowerState') eq true', 'properties/latestModelApplied eq true', 'properties/latestModelApplied eq false'.") | ||
| c.argument('select', options_list=['--select'], help="The list parameters. Allowed values are 'instanceView', 'instanceView/statuses'.") | ||
| c.argument('resiliency_view', options_list=["--resiliency-view"], help="Show resiliency status of each instance.") | ||
| c.argument('pagination_limit', options_list=['--max-items'], arg_group="Pagination", |
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.
please double check the type of the parameter. If the type is not string, please specify it manually
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |

Related command
az vmss get-resiliency-view --instance instance_idaz vmss list-instances --resiliency-viewDescription
Resolve #32361
Testing Guide
To make sure list-instances will show instances within the vmss with their resiliency status.
az vmss list-instances --resiliency-viewTo make sure resiliency status is being shown for target instance.
az vmss get-resiliency-view --instance instance_idHistory Notes
[Compute]
az vmss list-instances: Add new argument--resiliency-viewto show resiliency status of each instance[Compute]
az vmss get-resiliency-view: Add new command to show resiliency status of each instanceThis 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.