Add az aks list-vm-skus command to aks-preview extension#9698
Add az aks list-vm-skus command to aks-preview extension#9698yanzhudd merged 7 commits intoAzure:mainfrom
az aks list-vm-skus command to aks-preview extension#9698Conversation
|
| rule | cmd_name | rule_message | suggest_message |
|---|---|---|---|
| aks list-vm-skus | cmd aks list-vm-skus added |
|
Hi @CustardTart32, |
|
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>
|
CodeGen Tools Feedback CollectionThank you for using our CodeGen tool. We value your feedback, and we would like to know how we can improve our product. Please take a few minutes to fill our codegen survey |
There was a problem hiding this comment.
Pull request overview
Adds a new az aks list-vm-skus command to the aks-preview extension, backed by the AKS vmSkus ARM endpoint, with client-side filtering and table output formatting.
Changes:
- Introduces
aks list-vm-skuscommand wiring (client factory, command registration, args) and implements filtering (--size,--zone,--all). - Adds table formatter for
-o tableoutput. - Adds unit tests for SKU availability logic and command filtering, plus a scenario test.
Reviewed changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/aks-preview/azext_aks_preview/vm_skus_util.py | Adds helper to evaluate subscription/zone availability based on SKU restrictions. |
| src/aks-preview/azext_aks_preview/custom.py | Implements aks_list_vm_skus custom command (fetch + filters). |
| src/aks-preview/azext_aks_preview/commands.py | Registers aks list-vm-skus command and hooks table transformer. |
| src/aks-preview/azext_aks_preview/_params.py | Defines CLI parameters for aks list-vm-skus (--location, --size, --zone, --all). |
| src/aks-preview/azext_aks_preview/_format.py | Adds aks_list_vm_skus_table_format for table output summarization. |
| src/aks-preview/azext_aks_preview/_client_factory.py | Adds cf_vm_skus to access ContainerServiceClient.vm_skus. |
| src/aks-preview/azext_aks_preview/tests/latest/test_vm_skus.py | Unit tests for _aks_is_vm_sku_available. |
| src/aks-preview/azext_aks_preview/tests/latest/test_custom.py | Unit tests for aks_list_vm_skus filtering behavior. |
| src/aks-preview/azext_aks_preview/tests/latest/test_aks_commands.py | Adds scenario coverage for aks list-vm-skus basic/filtered calls. |
Release SuggestionsModule: aks-preview
Notes
|
|
/azp run |
|
Azure Pipelines successfully started running 2 pipeline(s). |
| options_list=["--zone", "-z"], | ||
| arg_type=get_three_state_flag(), |
There was a problem hiding this comment.
Do we need a three-state flag here? From what I understand, the list API already handles results with this filter by default. Wouldn't a single state be enough to toggle the filter? I'm concerned because we rarely use three-state flags in the aks command group, except for a few cases like the greater monitoring addon. This could affect consistency across all commands. The same applies to the --show-all option
There was a problem hiding this comment.
Changed to use a store_true action.
In term of the list API itself, it will filter out VM SKU's that are restricted by region but not by AZ (this might actually be an oversight that should be fixed in the internal API implementation).
The --zone flag is different in that it filters out any VM SKUs that do not have zones associated.
FumingZhang
left a comment
There was a problem hiding this comment.
Queued live test to validate the change.
e7ba3dc to
6b81746
Compare
|
/azp run |
|
Azure Pipelines successfully started running 2 pipeline(s). |
|
Re-queued live test. |
The test failed with an error. Need to queue the test using a sub that has the specific feature flag registered?
|
|
What subscription is the live test being run against? This seems pretty strange. I run the live tests locally in a loop and didn't get any test failures for |
6b81746 to
0890873
Compare
|
This one 79a7390d-3a85-432d-9f6f-a11a703c8b83 |
|
fixing the CI failure in #9703 |
|
Fixed the live test failure. Turns out that subscription didn't have any vm skus available in |
|
/azp run |
|
Azure Pipelines successfully started running 2 pipeline(s). |
Please rebase from main to pick up the fix, cc @CustardTart32 The CI |
Implements a new CLI command that lists VM SKUs available for AKS node pools in a given location by querying the AKS-specific vmSkus endpoint, mirroring the shape and filtering behavior of 'az vm list-skus'. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…_aks_list_vm_skus Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2c8b11f to
688f9f3
Compare
|
/azp run |
|
Azure Pipelines successfully started running 2 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 2 pipeline(s). |
This checklist is used to make sure that common guidelines for a pull request are followed.
Related command
az aks list-vm-skusGeneral Guidelines
azdev style <YOUR_EXT>locally? (pip install azdevrequired)python scripts/ci/test_index.py -qlocally? (pip install wheel==0.30.0required)For new extensions:
About Extension Publish
There is a pipeline to automatically build, upload and publish extension wheels.
Once your pull request is merged into main branch, a new pull request will be created to update
src/index.jsonautomatically.You only need to update the version information in file setup.py and historical information in file HISTORY.rst in your PR but do not modify
src/index.json.