Azure / Azure/azure-cli

download-batch command fails

Open
#26,469 3 comments 0 reactions 1 assignee Claimed by @evelyn-ys View on GitHub
act-codegen-extensibility-squad Auto-Assign Auto-Resolve Azure CLI Team customer-reported feature-request Storage
Dominant language
Python
Stars
4.6k
Forks
3.5k
Avg merge
3d 22h
Merged PRs (30d)
64

Description

### **Error when trying to download all file from a storage**

## Describe the bug
We have a bunch of diagnostic information dumped to the storage from our model. The blob name is just a printout of time when it was generated:
![image](https://github.com/Azure/azure-cli/assets/17622017/3dccfaba-d0db-4a15-be2a-e6a0f9f3dc61)

These blobs then have to be downloaded and processed on a separate machine. We tried to use the download-batch command, but it fails with the error described below.

**Command Name**
`az storage blob download-batch`

**Errors:**
```
The command failed with an unexpected error. Here is the traceback:
[Errno 22] Invalid argument: '.\\2023-04-19 06:47:50.6173Z'
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 663, in execute
File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 726, 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 718, 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 412, 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 412, in new_handler
File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/storage/_exception_handler.py", line 17, in file_related_exception_handler
File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 697, in _run_job
File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 333, in __call__
File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/command_operation.py", line 121, in handler
File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/storage/operations/blob.py", line 459, in storage_blob_download_batch
File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/storage/util.py", line 311, in wrapper
File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/storage/operations/blob.py", line 415, in _download_blob
File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/storage/operations/blob.py", line 683, in download_blob
OSError: [Errno 22] Invalid argument: '.\\2023-04-19 06:47:50.6173Z'
```

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

- put some blobs named like: `2023-04-19 06:47:50.6173Z`
- `az storage blob download-batch --destination {} --source {} --pattern {} --account-name {} --auth-mode {}`

## Environment Summary
```
Windows-10-10.0.19045-SP0
Python 3.10.10
Installer: MSI

azure-cli 2.47.0 *

Extensions:
ml 2.7.1

Dependencies:
msal 1.20.0
azure-mgmt-resource 22.0.0
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.