Describe the bug
az storage blob list does not use the documented AZURE_STORAGE_SERVICE_ENDPOINT environment variable when no --blob-endpoint argument is supplied.
This is particularly problematic when using Azurite, where the storage account does not exist on the public Azure endpoint.
Related command
az storage blob list
Environment:
AZURE_STORAGE_ACCOUNT=devstoreaccount1
AZURE_STORAGE_KEY=<standard Azurite key>
AZURE_STORAGE_SERVICE_ENDPOINT=http://localhost:10000/devstoreaccount1
Command:
az storage blob list --container-name container1 --auth-mode key
Expected:
Request goes to http://localhost:10000/devstoreaccount1/container1
Actual:
Request goes to https://devstoreaccount1.blob.core.windows.net/container1
Workaround:
az storage blob list \
--container-name container1 \
--auth-mode key \
--blob-endpoint "$AZURE_STORAGE_SERVICE_ENDPOINT"
Related command
az storage blob list --container-name container1 --auth-mode key
Errors
Authentication failure. This may be caused by either invalid account key, connection string or sas token value provided for your storage account.
Issue script & Debug output
> az storage blob list --container-name container1 --output table --debug
cli.knack.cli: Command arguments: ['storage', 'blob', 'list', '--container-name', 'container1', '--output', 'table', '--debug']
cli.knack.cli: __init__ debug log:
Enable color in terminal.
cli.knack.cli: Event: Cli.PreExecute []
cli.knack.cli: Event: CommandParser.OnGlobalArgumentsCreate [<function CLILogging.on_global_arguments at 0x75e26a812da0>, <function OutputProducer.on_global_arguments at 0x75e26a7380f0>, <function CLIQuery.on_global_arguments at 0x75e26a50e820>]
cli.knack.cli: Event: CommandInvoker.OnPreCommandTableCreate []
cli.azure.cli.core: Using packaged command index for profile 'latest'.
cli.azure.cli.core: Modules found from index for 'storage': ['azure.cli.command_modules.storage']
cli.azure.cli.core: Loading command modules...
cli.azure.cli.core: Name Load Time Groups Commands
cli.azure.cli.core: storage 0.108 63 281
cli.azure.cli.core: Loaded command modules:
cli.azure.cli.core: Total (1) 0.108 63 281
cli.azure.cli.core: Loaded 63 groups, 281 commands.
cli.azure.cli.core: Found a match in the command table.
cli.azure.cli.core: Raw command : storage blob list
cli.azure.cli.core: Command table: storage blob list
cli.knack.cli: Event: CommandInvoker.OnPreCommandTableTruncate [<function AzCliLogging.init_command_file_logging at 0x75e26a4d01a0>]
cli.azure.cli.core.azlogging: metadata file logging enabled - writing logs to '/home/user/.azure/commands/2026-10-01.11-58-54.storage_blob_list.4739.log'.
az_command_data_logger: command args: storage blob list --container-name {} --output {} --debug
cli.knack.cli: Event: CommandInvoker.OnPreArgumentLoad [<function register_global_subscription_argument.<locals>.add_subscription_parameter at 0x75e26a29da60>]
cli.knack.cli: Event: CommandInvoker.OnPostArgumentLoad []
cli.knack.cli: Event: CommandInvoker.OnPostCommandTableCreate [<function register_ids_argument.<locals>.add_ids_arguments at 0x75e26a29db10>, <function register_global_policy_argument.<locals>.add_global_policy_argument at 0x75e26a2b8d50>, <function register_cache_arguments.<locals>.add_cache_arguments at 0x75e26a2b8e00>, <function register_upcoming_breaking_change_info.<locals>.update_breaking_change_info at 0x75e26a2b8eb0>]
cli.knack.cli: Event: CommandInvoker.OnCommandTableLoaded []
cli.knack.cli: Event: CommandInvoker.OnPreParseArgs []
cli.knack.cli: Event: CommandInvoker.OnPostParseArgs [<function OutputProducer.handle_output_argument at 0x75e26a7381a0>, <function CLIQuery.handle_query_parameter at 0x75e26a50e8d0>, <function register_ids_argument.<locals>.parse_ids_arguments at 0x75e26a2b8ca0>]
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 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.
urllib3.connectionpool: Starting new HTTPS connection (1): devstoreaccount1.blob.core.windows.net:443
urllib3.connectionpool: https://devstoreaccount1.blob.core.windows.net:443 "GET /container1?restype=container&comp=list&maxresults=5000 HTTP/1.1" 403 761
cli.azure.cli.core.azclierror: Traceback (most recent call last):
File "/opt/az/lib/python3.14/site-packages/knack/cli.py", line 233, in invoke
cmd_result = self.invocation.execute(args)
File "/opt/az/lib/python3.14/site-packages/azure/cli/core/commands/__init__.py", line 677, in execute
raise ex
File "/opt/az/lib/python3.14/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/az/lib/python3.14/site-packages/azure/cli/core/commands/__init__.py", line 812, in _run_job
return cmd_copy.exception_handler(ex)
~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^
File "/opt/az/lib/python3.14/site-packages/azure/cli/command_modules/storage/__init__.py", line 357, in new_handler
first(ex)
~~~~~^^^^
File "/opt/az/lib/python3.14/site-packages/azure/cli/command_modules/storage/__init__.py", line 356, in new_handler
raise ex
File "/opt/az/lib/python3.14/site-packages/azure/cli/core/commands/__init__.py", line 789, in _run_job
result = cmd_copy(params)
File "/opt/az/lib/python3.14/site-packages/azure/cli/core/commands/__init__.py", line 335, in __call__
return self.handler(*args, **kwargs)
~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
File "/opt/az/lib/python3.14/site-packages/azure/cli/core/commands/command_operation.py", line 120, in handler
return op(**command_args)
File "/opt/az/lib/python3.14/site-packages/azure/cli/command_modules/storage/operations/blob.py", line 202, in list_blobs
result = list_generator(pages=pages, num_results=num_results)
File "/opt/az/lib/python3.14/site-packages/azure/cli/command_modules/storage/track2_util.py", line 74, in list_generator
page = list(next(pages))
~~~~^^^^^^^
File "/opt/az/lib/python3.14/site-packages/azure/core/paging.py", line 82, in __next__
self._response = self._get_next(self.continuation_token)
~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/az/lib/python3.14/site-packages/azure/storage/blob/_list_blobs_helper.py", line 96, in _get_next_cb
process_storage_error(error)
~~~~~~~~~~~~~~~~~~~~~^^^^^^^
File "/opt/az/lib/python3.14/site-packages/azure/storage/blob/_shared/response_handlers.py", line 195, in process_storage_error
exec("raise error from None") # pylint: disable=exec-used # nosec
~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
File "<string>", line 1, in <module>
azure.core.exceptions.ClientAuthenticationError:
Authentication failure. This may be caused by either invalid account key, connection string or sas token value provided for your storage account.
Content: <?xml version="1.0" encoding="utf-8"?><Error><Code>AuthenticationFailed</Code><Message>Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.
RequestId:9c27a114-701e-004b-1293-51d112000000
Time:2026-10-01T10:58:55.6240841Z</Message><AuthenticationErrorDetail>The MAC signature found in the HTTP request 'MVoVtjoHXQoDSOFjtht9q1e6UdXymiRJrdunzxRIjMA=' is not the same as any computed signature. Server used following string to sign: 'GET
x-ms-client-request-id:1839d776-bd87-11f1-9176-00155d613413
x-ms-date:Thu, 01 Oct 2026 10:58:54 GMT
x-ms-version:2026-04-06
/devstoreaccount1/container1
comp:list
maxresults:5000
restype:container'.</AuthenticationErrorDetail></Error>
cli.azure.cli.core.azclierror:
Authentication failure. This may be caused by either invalid account key, connection string or sas token value provided for your storage account.
az_command_data_logger:
Authentication failure. This may be caused by either invalid account key, connection string or sas token value provided for your storage account.
cli.knack.cli: Event: Cli.PostExecute [<function AzCliLogging.deinit_cmd_metadata_logging at 0x75e26a4d0460>]
az_command_data_logger: exit code: 1
cli.__main__: Command ran in 1.301 seconds (init: 0.110, invoke: 1.191)
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 4052 in cache file under /home/user/.azure/telemetry/20261001115855846
telemetry.main: Begin creating telemetry upload process.
telemetry.process: Creating upload process: "/opt/az/bin/python3 /opt/az/lib/python3.14/site-packages/azure/cli/telemetry/__init__.py /home/user/.azure /home/user/.azure/telemetry/20261001115855846"
telemetry.process: Return from creating process 4758
telemetry.main: Finish creating telemetry upload process.
Expected behavior
Request goes to http://localhost:10000/devstoreaccount1/container1
Environment Summary
azure-cli 2.90.0
core 2.90.0
telemetry 1.1.0
Dependencies:
msal 1.36.0
azure-mgmt-resource 24.0.0
Python location '/opt/az/bin/python3'
Config directory '/home/user/.azure'
Extensions directory '/home/user/.azure/cliextensions'
Python (Linux) 3.14.6 (main, Aug 26 2026, 01:26:36) [GCC 11.4.0]
Legal docs and information: aka.ms/AzureCliLegal
Your CLI is up-to-date.
Additional context
No response
Describe the bug
az storage blob listdoes not use the documentedAZURE_STORAGE_SERVICE_ENDPOINTenvironment variable when no--blob-endpointargument is supplied.This is particularly problematic when using Azurite, where the storage account does not exist on the public Azure endpoint.
Related command
az storage blob listEnvironment:
Command:
az storage blob list --container-name container1 --auth-mode keyExpected:
Request goes to
http://localhost:10000/devstoreaccount1/container1Actual:
Request goes to
https://devstoreaccount1.blob.core.windows.net/container1Workaround:
Related command
az storage blob list --container-name container1 --auth-mode keyErrors
Authentication failure. This may be caused by either invalid account key, connection string or sas token value provided for your storage account.
Issue script & Debug output
Expected behavior
Request goes to
http://localhost:10000/devstoreaccount1/container1Environment Summary
azure-cli 2.90.0
core 2.90.0
telemetry 1.1.0
Dependencies:
msal 1.36.0
azure-mgmt-resource 24.0.0
Python location '/opt/az/bin/python3'
Config directory '/home/user/.azure'
Extensions directory '/home/user/.azure/cliextensions'
Python (Linux) 3.14.6 (main, Aug 26 2026, 01:26:36) [GCC 11.4.0]
Legal docs and information: aka.ms/AzureCliLegal
Your CLI is up-to-date.
Additional context
No response