Skip to content

az storage file delete-batch builds urls for subdirectories with %5 instead of / - resulting in failure #32135

@AronHetLam

Description

@AronHetLam

Describe the bug

When executing:
az storage file delete-batch --account-name ACCOUNT --source SHARE/dir --account-key KEY

I get the following error

The requested URI does not represent any resource on the server.
RequestId:7f021053-501a-00c7-34e0-270156000000
Time:2025-09-17T14:36:46.5857815Z
ErrorCode:InvalidUri
uripath:https://ACCOUNT.file.core.windows.net/SHARE/dir/SUBDIR%5NESTED_SUBDIR?restype=directory&comp=list

Trying a couple of different subdirs for the --source flag it seems that nested subdirs from the specified source are built incorrectly with the / replaced by %5.

Related command

az storage file delete-batch

Errors

The requested URI does not represent any resource on the server.
RequestId:7f021053-501a-00c7-34e0-270156000000
Time:2025-09-17T14:36:46.5857815Z
ErrorCode:InvalidUri
uripath:https://ACCOUNT.file.core.windows.net/SHARE/dir/SUBDIR%5NESTED_SUBDIR?restype=directory&comp=list

Issue script & Debug output

az storage file delete-batch --account-name ACCOUNT --source SHARE/dir --account-key KEY --debug

Partial debug output:

cli.azure.cli.core.azclierror: Traceback (most recent call last):
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\knack/cli.py", line 233, in invoke
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 666, in execute
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 734, in _run_jobs_serially
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 726, in _run_job
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/storage/__init__.py", line 358, in new_handler
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/storage/__init__.py", line 357, in new_handler
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 703, in _run_job
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 336, in __call__
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/command_operation.py", line 120, in handler
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/storage/operations/file.py", line 349, in storage_file_delete_batch
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/storage/util.py", line 99, in glob_files_remotely_track2
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/core/paging.py", line 136, in __next__
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/core/paging.py", line 82, in __next__
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/multiapi/storagev2/fileshare/v2025_05_05/_models.py", line 1022, in _get_next_cb
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/multiapi/storagev2/fileshare/v2025_05_05/_shared/response_handlers.py", line 186, in process_storage_error
  File "<string>", line 1, in <module>
azure.core.exceptions.HttpResponseError: The requested URI does not represent any resource on the server.
RequestId:330653b3-d01a-002d-33e1-272678000000
Time:2025-09-17T14:46:44.6633506Z
ErrorCode:InvalidUri

Expected behavior

Files are deleted within the specified source directory.

Environment Summary

azure-cli 2.77.0

core 2.77.0
telemetry 1.1.0

Dependencies:
msal 1.34.0b1
azure-mgmt-resource 23.3.0

Python location 'C:\Program Files\Microsoft SDKs\Azure\CLI2\python.exe'
Config directory 'C:\Users\Aron.azure'
Extensions directory 'C:\Users\Aron.azure\cliextensions'

Python (Windows) 3.13.7 (tags/v3.13.7:bcee1c3, Aug 14 2025, 14:15:11) [MSC v.1944 64 bit (AMD64)]

Legal docs and information: aka.ms/AzureCliLegal

Your CLI is up-to-date.

Additional context

No response

Metadata

Metadata

Labels

Auto-AssignAuto assign by botAzure CLI TeamThe command of the issue is owned by Azure CLI teamStorageaz storagecustomer-reportedIssues that are reported by GitHub users external to the Azure organization.questionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions