Skip to content

[Storage] fix az storage container list failure - #33793

Draft
Pan-Qi wants to merge 2 commits into
devfrom
bernard-fix-storage-container-list-failure
Draft

[Storage] fix az storage container list failure#33793
Pan-Qi wants to merge 2 commits into
devfrom
bernard-fix-storage-container-list-failure

Conversation

@Pan-Qi

@Pan-Qi Pan-Qi commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Related command

az storage container list

Description

#33671

Fixes noisy storage command argument-loading failures where az storage container list --debug attempted to import non-existent management-plane modules such as azure.mgmt.storage.blob and azure.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 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

Hi @Pan-Qi,
Since the current milestone time is less than 7 days, this pr will be reviewed in the next milestone.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@yonzhan

yonzhan commented Jul 27, 2026

Copy link
Copy Markdown
Collaborator

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

@jsntcy
jsntcy marked this pull request as ready for review July 27, 2026 06:47
@jsntcy
jsntcy requested a review from a team as a code owner July 27, 2026 06:47
Copilot AI review requested due to automatic review settings July 27, 2026 06:47
@jsntcy
jsntcy marked this pull request as draft July 27, 2026 06:47
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 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-sas policy-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.

@Pan-Qi
Pan-Qi force-pushed the bernard-fix-storage-container-list-failure branch from 2c36c58 to bf90740 Compare July 28, 2026 13:37
@Pan-Qi Pan-Qi added the ai-custom-code Code generated by ai-custom-code Github Copilot agent. label Jul 28, 2026
@microsoft-github-policy-service

Copy link
Copy Markdown
Contributor

🔔 Routing this PR to @Azure/act-codegen-extensibility-squad.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

act-codegen-extensibility-squad ai-custom-code Code generated by ai-custom-code Github Copilot agent. Auto-Assign Auto assign by bot Storage az storage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants