[Storage] fix az storage container list failure#33793
Conversation
|
Hi @Pan-Qi, |
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
|
Thank you for your contribution! We will review the pull request and get back to you soon. |
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
There was a problem hiding this comment.
Pull request overview
This PR fixes noisy argument-loading failures for az storage container list --debug by removing legacy SDK model resolution from storage completers and switching affected blob/container/file-share completers to Track 2 client-factory-backed implementations. This prevents the CLI profile loader from attempting to import non-existent management-plane modules (e.g., azure.mgmt.storage.blob, azure.mgmt.storage.file) during argument loading.
Changes:
- Added Track 2-aware name and ACL completer helpers that build clients via existing storage client factories (after
validate_client_parameters). - Updated storage argument definitions to use Track 2 completers for blob/container/share-related completions (and removed the legacy
get_sdk(...)calls that triggered the import noise). - Adjusted the
storage file generate-saspolicy-name help text to correctly refer to file share ACLs.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/azure-cli/azure/cli/command_modules/storage/completers.py |
Adds Track 2 client-factory-based completion helpers for names and ACL policy IDs. |
src/azure-cli/azure/cli/command_modules/storage/_params.py |
Rewires several blob/container/file-share completers to the new Track 2 helpers and removes legacy SDK lookups that caused import failures. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Related command
az storage container list
Description
#33671
Fixes noisy storage command argument-loading failures where
az storage container list --debugattempted to import non-existent management-plane modules such asazure.mgmt.storage.blobandazure.mgmt.storage.file.The storage command module defaults SDK lookup to
MGMT_STORAGE, but several blob/file completers were still resolving legacy data-plane SDK models during argument loading without explicitly using the data-plane resource type. This caused the CLI profile loader to try management-plane import paths before the command reached normal validation.This change moves the affected blob/container/file-share completers to Track 2 client-factory-backed helpers using existing storage client factories. The completers now avoid eager legacy SDK resolution during argument loading and align with the Track 2 storage packages already pinned by the CLI.
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 featureThis 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.