Skip to content

[Storage] Fix #33671: az storage container list: Doesn't return anything with ModuleNotFoundError - #33793

Open
Qi Pan (Pan-Qi) wants to merge 3 commits into
devfrom
bernard-fix-storage-container-list-failure
Open

[Storage] Fix #33671: az storage container list: Doesn't return anything with ModuleNotFoundError#33793
Qi Pan (Pan-Qi) wants to merge 3 commits into
devfrom
bernard-fix-storage-container-list-failure

Conversation

@Pan-Qi

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

Copy link
Copy Markdown
Contributor

🤖 PR Validation — ❌ Action needed

Breaking Changes Tests
❌ 1 ️✔️ 130/130
❌AzureCLI-BreakingChangeTest
❌servicebus
rule cmd_name rule_message suggest_message
1007 - ParaRemove servicebus georecovery-alias authorization-rule list cmd servicebus georecovery-alias authorization-rule list removed parameter pagination_limit please add back parameter pagination_limit for cmd servicebus georecovery-alias authorization-rule list
1007 - ParaRemove servicebus georecovery-alias authorization-rule list cmd servicebus georecovery-alias authorization-rule list removed parameter pagination_token please add back parameter pagination_token for cmd servicebus georecovery-alias authorization-rule list
1008 - ParaPropAdd servicebus georecovery-alias create cmd servicebus georecovery-alias create update parameter partner_namespace: added property required=True please remove property required=True for parameter partner_namespace of cmd servicebus georecovery-alias create
1007 - ParaRemove servicebus georecovery-alias list cmd servicebus georecovery-alias list removed parameter pagination_limit please add back parameter pagination_limit for cmd servicebus georecovery-alias list
1007 - ParaRemove servicebus georecovery-alias list cmd servicebus georecovery-alias list removed parameter pagination_token please add back parameter pagination_token for cmd servicebus georecovery-alias list
1007 - ParaRemove servicebus migration list cmd servicebus migration list removed parameter pagination_limit please add back parameter pagination_limit for cmd servicebus migration list
1007 - ParaRemove servicebus migration list cmd servicebus migration list removed parameter pagination_token please add back parameter pagination_token for cmd servicebus migration list
1007 - ParaRemove servicebus namespace authorization-rule list cmd servicebus namespace authorization-rule list removed parameter pagination_limit please add back parameter pagination_limit for cmd servicebus namespace authorization-rule list
1007 - ParaRemove servicebus namespace authorization-rule list cmd servicebus namespace authorization-rule list removed parameter pagination_token please add back parameter pagination_token for cmd servicebus namespace authorization-rule list
1007 - ParaRemove servicebus namespace create cmd servicebus namespace create removed parameter ip_address_type please add back parameter ip_address_type for cmd servicebus namespace create
1007 - ParaRemove servicebus namespace list cmd servicebus namespace list removed parameter pagination_limit please add back parameter pagination_limit for cmd servicebus namespace list
1007 - ParaRemove servicebus namespace list cmd servicebus namespace list removed parameter pagination_token please add back parameter pagination_token for cmd servicebus namespace list
1007 - ParaRemove servicebus namespace network-rule-set list cmd servicebus namespace network-rule-set list removed parameter pagination_limit please add back parameter pagination_limit for cmd servicebus namespace network-rule-set list
1007 - ParaRemove servicebus namespace network-rule-set list cmd servicebus namespace network-rule-set list removed parameter pagination_token please add back parameter pagination_token for cmd servicebus namespace network-rule-set list
1007 - ParaRemove servicebus namespace private-endpoint-connection list cmd servicebus namespace private-endpoint-connection list removed parameter pagination_limit please add back parameter pagination_limit for cmd servicebus namespace private-endpoint-connection list
1007 - ParaRemove servicebus namespace private-endpoint-connection list cmd servicebus namespace private-endpoint-connection list removed parameter pagination_token please add back parameter pagination_token for cmd servicebus namespace private-endpoint-connection list
1007 - ParaRemove servicebus namespace private-link-resource show cmd servicebus namespace private-link-resource show removed parameter pagination_limit please add back parameter pagination_limit for cmd servicebus namespace private-link-resource show
1007 - ParaRemove servicebus namespace private-link-resource show cmd servicebus namespace private-link-resource show removed parameter pagination_token please add back parameter pagination_token for cmd servicebus namespace private-link-resource show
1007 - ParaRemove servicebus namespace update cmd servicebus namespace update removed parameter ip_address_type please add back parameter ip_address_type for cmd servicebus namespace update
1007 - ParaRemove servicebus namespace update cmd servicebus namespace update removed parameter platform_capabilities please add back parameter platform_capabilities for cmd servicebus namespace update
1007 - ParaRemove servicebus queue authorization-rule list cmd servicebus queue authorization-rule list removed parameter pagination_limit please add back parameter pagination_limit for cmd servicebus queue authorization-rule list
1007 - ParaRemove servicebus queue authorization-rule list cmd servicebus queue authorization-rule list removed parameter pagination_token please add back parameter pagination_token for cmd servicebus queue authorization-rule list
1007 - ParaRemove servicebus queue create cmd servicebus queue create removed parameter user_metadata please add back parameter user_metadata for cmd servicebus queue create
1007 - ParaRemove servicebus queue list cmd servicebus queue list removed parameter pagination_limit please add back parameter pagination_limit for cmd servicebus queue list
1007 - ParaRemove servicebus queue list cmd servicebus queue list removed parameter pagination_token please add back parameter pagination_token for cmd servicebus queue list
1007 - ParaRemove servicebus queue update cmd servicebus queue update removed parameter enable_duplicate_detection please add back parameter enable_duplicate_detection for cmd servicebus queue update
1007 - ParaRemove servicebus queue update cmd servicebus queue update removed parameter enable_partitioning please add back parameter enable_partitioning for cmd servicebus queue update
1007 - ParaRemove servicebus queue update cmd servicebus queue update removed parameter enable_session please add back parameter enable_session for cmd servicebus queue update
1007 - ParaRemove servicebus queue update cmd servicebus queue update removed parameter user_metadata please add back parameter user_metadata for cmd servicebus queue update
1007 - ParaRemove servicebus topic authorization-rule list cmd servicebus topic authorization-rule list removed parameter pagination_limit please add back parameter pagination_limit for cmd servicebus topic authorization-rule list
1007 - ParaRemove servicebus topic authorization-rule list cmd servicebus topic authorization-rule list removed parameter pagination_token please add back parameter pagination_token for cmd servicebus topic authorization-rule list
1007 - ParaRemove servicebus topic create cmd servicebus topic create removed parameter user_metadata please add back parameter user_metadata for cmd servicebus topic create
1007 - ParaRemove servicebus topic list cmd servicebus topic list removed parameter pagination_limit please add back parameter pagination_limit for cmd servicebus topic list
1007 - ParaRemove servicebus topic list cmd servicebus topic list removed parameter pagination_token please add back parameter pagination_token for cmd servicebus topic list
1007 - ParaRemove servicebus topic subscription create cmd servicebus topic subscription create removed parameter user_metadata please add back parameter user_metadata for cmd servicebus topic subscription create
1007 - ParaRemove servicebus topic subscription list cmd servicebus topic subscription list removed parameter pagination_limit please add back parameter pagination_limit for cmd servicebus topic subscription list
1007 - ParaRemove servicebus topic subscription list cmd servicebus topic subscription list removed parameter pagination_token please add back parameter pagination_token for cmd servicebus topic subscription list
1007 - ParaRemove servicebus topic subscription rule list cmd servicebus topic subscription rule list removed parameter pagination_limit please add back parameter pagination_limit for cmd servicebus topic subscription rule list
1007 - ParaRemove servicebus topic subscription rule list cmd servicebus topic subscription rule list removed parameter pagination_token please add back parameter pagination_token for cmd servicebus topic subscription rule list
1007 - ParaRemove servicebus topic subscription update cmd servicebus topic subscription update removed parameter user_metadata please add back parameter user_metadata for cmd servicebus topic subscription update
1007 - ParaRemove servicebus topic update cmd servicebus topic update removed parameter user_metadata please add back parameter user_metadata for cmd servicebus topic update
⚠️ 1010 - ParaPropUpdate servicebus namespace update cmd servicebus namespace update update parameter minimum_tls_version: updated property choices from ['1.0', '1.1', '1.2', '1.3'] to ['1.0', '1.1', '1.2']

Please submit your Breaking Change Pre-announcement ASAP if you haven't already. Please note:

  • Breaking changes can only be merged during the designated breaking change window
  • A pre-announcement must be released at least one month in advance

For more details on how to introduce breaking changes, refer to the documentation: azure-cli/doc/how_to_introduce_breaking_changes.md

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 Qi Pan (@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

Copy link
Copy Markdown
Collaborator

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

@jsntcy
Yu Chen (jsntcy) marked this pull request as ready for review July 27, 2026 06:47
@jsntcy
Yu Chen (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
Yu Chen (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
Qi Pan (Pan-Qi) force-pushed the bernard-fix-storage-container-list-failure branch from 2c36c58 to bf90740 Compare July 28, 2026 13:37
@Pan-Qi Qi Pan (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.

@Pan-Qi
Qi Pan (Pan-Qi) marked this pull request as ready for review August 5, 2026 06:02
@azure-pipelines

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

@yonzhan

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).

@necusjz Ethan Yang (necusjz) changed the title [Storage] fix az storage container list failure [Storage] az storage container list: Fix ModuleNotFoundError Aug 12, 2026
@necusjz

Ethan Yang (necusjz) commented Aug 12, 2026

Copy link
Copy Markdown
Member

let's rerun a test case that can cover az storage container list --account-name {} --auth-mode {} and upload the recording file.

@necusjz Ethan Yang (necusjz) changed the title [Storage] az storage container list: Fix ModuleNotFoundError [Storage] Fix #33671: az storage container list: Doesn't return anything with ModuleNotFoundError Aug 12, 2026
@Pan-Qi

Copy link
Copy Markdown
Contributor Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).

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.

4 participants