Skip to content

az storage container list failure #33671

Closed

Description

@petefc-bc

This is autogenerated. Please review and update as needed.

Describe the bug

az storage container list
does not return

az version
{
"azure-cli": "2.87.0",
"azure-cli-core": "2.87.0",
"azure-cli-telemetry": "1.1.0",
"extensions": {
"account": "0.2.5",
"log-analytics": "1.0.0b1",
"resource-graph": "2.1.1",
"ssh": "2.0.9"
}
}

Errors:

cli.knack.cli: Event: CommandInvoker.OnPreCommandTableTruncate [<function AzCliLogging.init_command_file_logging at 0x1049a6ac0>]
cli.azure.cli.core.azlogging: metadata file logging enabled - writing logs to '/Users/petercharles/.azure/commands/2026-06-29.09-44-23.storage_container_list.89472.log'.
az_command_data_logger: command args: storage container list --debug
cli.knack.cli: Event: CommandInvoker.OnPreArgumentLoad [<function register_global_subscription_argument.<locals>.add_subscription_parameter at 0x1049e4180>]
cli.azure.cli.core.profiles._shared: Traceback (most recent call last):
  File "/opt/homebrew/Cellar/azure-cli/2.87.0/libexec/lib/python3.13/site-packages/azure/cli/core/profiles/_shared.py", line 437, in _get_attr
    op = import_module(full_mod_path)
  File "/opt/homebrew/Cellar/python@3.13/3.13.14/Frameworks/Python.framework/Versions/3.13/lib/python3.13/importlib/__init__.py", line 88, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1395, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1310, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1395, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1324, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'azure.mgmt.storage.blob'

cli.azure.cli.core.profiles._shared: Traceback (most recent call last):
  File "/opt/homebrew/Cellar/azure-cli/2.87.0/libexec/lib/python3.13/site-packages/azure/cli/core/profiles/_shared.py", line 437, in _get_attr
    op = import_module(full_mod_path)
  File "/opt/homebrew/Cellar/python@3.13/3.13.14/Frameworks/Python.framework/Versions/3.13/lib/python3.13/importlib/__init__.py", line 88, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1395, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1324, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'azure.mgmt.storage.file'

cli.azure.cli.core.profiles._shared: Traceback (most recent call last):
  File "/opt/homebrew/Cellar/azure-cli/2.87.0/libexec/lib/python3.13/site-packages/azure/cli/core/profiles/_shared.py", line 437, in _get_attr
    op = import_module(full_mod_path)
  File "/opt/homebrew/Cellar/python@3.13/3.13.14/Frameworks/Python.framework/Versions/3.13/lib/python3.13/importlib/__init__.py", line 88, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1395, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1310, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1395, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1324, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'azure.mgmt.storage.file'

cli.knack.cli: Event: CommandInvoker.OnPostArgumentLoad []
cli.knack.cli: Event: CommandInvoker.OnPostCommandTableCreate [<function register_ids_argument.<locals>.add_ids_arguments at 0x1049e47c0>, <function register_global_policy_argument.<locals>.add_global_policy_argument at 0x1049e4900>, <function register_cache_arguments.<locals>.add_cache_arguments at 0x1049e49a0>, <function register_upcoming_breaking_change_info.<locals>.update_breaking_change_info at 0x1049e4a40>]
cli.knack.cli: Event: CommandInvoker.OnCommandTableLoaded []
cli.knack.cli: Event: CommandInvoker.OnPreParseArgs []
cli.knack.cli: Event: CommandInvoker.OnPostParseArgs [<function OutputProducer.handle_output_argument at 0x102f23240>, <function CLIQuery.handle_query_parameter at 0x102f596c0>, <function register_ids_argument.<locals>.parse_ids_arguments at 0x1049e4860>]
cli.azure.cli.command_modules.storage._validators: Try to get storage auth_mode value from environment variables or config file.
cli.azure.cli.command_modules.storage._validators: Try to get storage account value from environment variables or config file.
cli.azure.cli.command_modules.storage._validators: Try to get storage account_url value from environment variables or config file.
cli.azure.cli.command_modules.storage._validators: Try to get storage connection_string value from environment variables or config file.
cli.azure.cli.command_modules.storage._validators: Try to get storage account value from environment variables or config file.
cli.azure.cli.command_modules.storage._validators: Try to get storage account_url value from environment variables or config file.
cli.azure.cli.command_modules.storage._validators: Try to get storage key value from environment variables or config file.
cli.azure.cli.command_modules.storage._validators: Try to get storage sas_token value from environment variables or config file.
cli.azure.cli.core.azclierror: Traceback (most recent call last):
  File "/opt/homebrew/Cellar/azure-cli/2.87.0/libexec/lib/python3.13/site-packages/knack/cli.py", line 233, in invoke
    cmd_result = self.invocation.execute(args)
  File "/opt/homebrew/Cellar/azure-cli/2.87.0/libexec/lib/python3.13/site-packages/azure/cli/core/commands/__init__.py", line 677, in execute
    raise ex
  File "/opt/homebrew/Cellar/azure-cli/2.87.0/libexec/lib/python3.13/site-packages/azure/cli/core/commands/__init__.py", line 820, in _run_jobs_serially
    results.append(self._run_job(expanded_arg, cmd_copy))
                   ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/azure-cli/2.87.0/libexec/lib/python3.13/site-packages/azure/cli/core/commands/__init__.py", line 812, in _run_job
    return cmd_copy.exception_handler(ex)
           ~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^
  File "/opt/homebrew/Cellar/azure-cli/2.87.0/libexec/lib/python3.13/site-packages/azure/cli/command_modules/storage/__init__.py", line 357, in new_handler
    first(ex)
    ~~~~~^^^^
  File "/opt/homebrew/Cellar/azure-cli/2.87.0/libexec/lib/python3.13/site-packages/azure/cli/command_modules/storage/__init__.py", line 356, in new_handler
    raise ex
  File "/opt/homebrew/Cellar/azure-cli/2.87.0/libexec/lib/python3.13/site-packages/azure/cli/core/commands/__init__.py", line 789, in _run_job
    result = cmd_copy(params)
  File "/opt/homebrew/Cellar/azure-cli/2.87.0/libexec/lib/python3.13/site-packages/azure/cli/core/commands/__init__.py", line 335, in __call__
    return self.handler(*args, **kwargs)
           ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/azure-cli/2.87.0/libexec/lib/python3.13/site-packages/azure/cli/core/commands/command_operation.py", line 111, in handler
    client = self.client_factory(self.cli_ctx, command_args) if self.client_factory else None
             ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/azure-cli/2.87.0/libexec/lib/python3.13/site-packages/azure/cli/command_modules/storage/_client_factory.py", line 143, in cf_blob_service
    account_url = get_account_url(cli_ctx, account_name=account_name, service='blob')
  File "/opt/homebrew/Cellar/azure-cli/2.87.0/libexec/lib/python3.13/site-packages/azure/cli/command_modules/storage/_client_factory.py", line 109, in get_account_url
    raise CLIError("Please provide storage account name or connection string.")
knack.util.CLIError: Please provide storage account name or connection string.

cli.azure.cli.core.azclierror: Please provide storage account name or connection string.
az_command_data_logger: Please provide storage account name or connection string.
cli.knack.cli: Event: Cli.PostExecute [<function AzCliLogging.deinit_cmd_metadata_logging at 0x1049a6d40>]
az_command_data_logger: exit code: 1
cli.__main__: Command ran in 0.497 seconds (init: 0.066, invoke: 0.431)
telemetry.main: Begin splitting cli events and extra events, total events: 1
telemetry.main: Finish splitting cli events and extra events, cli events: 1
telemetry.save: Save telemetry record of length 4175 in cache file under /Users/petercharles/.azure/telemetry/20260629094424188
telemetry.main: Begin creating telemetry upload process.
telemetry.process: Creating upload process: "/opt/homebrew/Cellar/azure-cli/2.87.0/libexec/bin/python /opt/homebrew/Cellar/azure-cli/2.87.0/libexec/lib/python3.13/site-packages/azure/cli/telemetry/__init__.py /Users/petercharles/.azure /Users/petercharles/.azure/telemetry/20260629094424188"
telemetry.process: Return from creating process 89478
telemetry.main: Finish creating telemetry upload process.

To Reproduce:

Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.

  • Put any pre-requisite steps here...
  • az storage container list --account-name {} --auth-mode {}

Expected Behavior

Environment Summary

macOS-14.6.1-arm64-arm-64bit-Mach-O, Darwin 23.6.0
Python 3.13.14
Installer: HOMEBREW

azure-cli 2.87.0

Extensions:
account 0.2.5
log-analytics 1.0.0b1
resource-graph 2.1.1
ssh 2.0.9

Dependencies:
msal 1.36.0
azure-mgmt-resource 24.0.0

Additional Context

Activity

  1. yonzhan commented on Jun 29, 2026

    @yonzhan
    Collaborator

    Thank you for opening this issue, we will look into it.

  2. added
    customer-reportedIssues that are reported by GitHub users external to the Azure organization.
    Azure CLI TeamThe command of the issue is owned by Azure CLI team
    questionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that
    on Jun 29, 2026
  3. added this to the Backlog milestone on Jun 30, 2026
  4. added
    bugThis issue requires a change to an existing behavior in the product in order to be resolved.
    on Jul 15, 2026
  5. x-engineering-agent commented on Jul 15, 2026

    @x-engineering-agent
    Contributor

    Bug Analysis

    az storage container list fails with:

    ModuleNotFoundError: No module named 'azure.mgmt.storage.blob'
    ModuleNotFoundError: No module named 'azure.mgmt.storage.file'
    

    This happens during SDK profile resolution in azure/cli/core/profiles/_shared.py (_get_attr), which tries to import operation modules for the storage management SDK (azure.mgmt.storage.blob / azure.mgmt.storage.file) that don't exist in the installed azure-mgmt-storage version. This points to a stale or incorrect module path/profile mapping for the storage command module (likely in azure/cli/core/profiles/_shared.py or the storage command module's client factory / SDK utils), causing it to reference submodules that were removed or restructured in a newer azure-mgmt-storage release.

    • Environment: azure-cli 2.87.0, azure-cli-core 2.87.0
    • Command: az storage container list
    • Actual behavior: Command raises ModuleNotFoundError during command table/profile initialization before performing the actual list operation.
    • Expected behavior: The command should list blob containers without raising import errors.

    Please investigate the SDK profile mapping used by the storage module (azure.cli.command_modules.storage) and azure.cli.core.profiles._shared to ensure it references valid submodules in the currently pinned azure-mgmt-storage version, and add/adjust a regression test under src/azure-cli/azure/cli/command_modules/storage/tests/ covering az storage container list.

    Use this EXACT PR title: [Storage] Fix #33671: \az storage container list`: fix ModuleNotFoundError for azure.mgmt.storage.blob/file`

    PR title & description format (required)

    This repo enforces a PR format (guide). Please author the PR exactly as follows or CI's Check the Format of Pull Request Title and Content will fail.

    Use this EXACT PR title (copy verbatim, do not reword):

    [Storage] Fix #33671: `az storage container list`: fix ModuleNotFoundError for azure.mgmt.storage.blob/file
    

    Keep the backticks around the command and the Fix #33671: prefix. You may only adjust the wording after the command (the final summary) if the fix changes; the [Storage] prefix, issue link, and backticked command must stay.

    Description — follow the PR template and fill in:

    • Link the issue — start the Description with a closing keyword so the PR auto-links and closes it: Fixes #33671.
    • Related command — the az storage container list command this affects.
    • Description (mandatory) — why the bug happens, what you changed, and the resulting behavior.
    • Testing Guide — example command(s) showing the fix works.
    • History Notes — leave the title to drive the history note, or add extra lines in the same format (component in brackets + the command in backticks), e.g. [Storage] `az storage container list`: <note>.
    • Keep the template checklist and tick the items you've satisfied.

    Posted by agent-assist (autonomous bug-fix pipeline).

  6. microsoft-github-policy-service commented on Jul 15, 2026

    @microsoft-github-policy-service
    Contributor

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

  7. removed
    questionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that
    on Jul 15, 2026
  8. added a commit that references this issue on Aug 19, 2026
    3b067c8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Auto-AssignAuto assign by botAzure CLI TeamThe command of the issue is owned by Azure CLI teamStorageaz storageact-codegen-extensibility-squadbugThis issue requires a change to an existing behavior in the product in order to be resolved.customer-reportedIssues that are reported by GitHub users external to the Azure organization.

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions