question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"az storage blob upload-batch" no longer works

See original GitHub issue

Describe the bug

Using mcr.microsoft.com/azure-cli:latest fails with “No such file or directory: ‘$web’”. However using mcr.microsoft.com/azure-cli:2.9.1 works.

To Reproduce

Using mcr.microsoft.com/azure-cli:latest

$ az storage blob upload-batch -s ./build -d '$web' --account-name $AZURE_STORAGE_ACCOUNT_NAME --account-key $AZURE_STORAGE_ACCESS_KEY

The command failed with an unexpected error. Here is the traceback:
 [Errno 2] No such file or directory: '$web'
 Traceback (most recent call last):
   File "/usr/local/lib/python3.6/site-packages/knack/cli.py", line 215, in invoke
     cmd_result = self.invocation.execute(args)
   File "/usr/local/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 654, in execute
     raise ex
   File "/usr/local/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 718, in _run_jobs_serially
     results.append(self._run_job(expanded_arg, cmd_copy))
   File "/usr/local/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 709, in _run_job
     cmd_copy.exception_handler(ex)
   File "/usr/local/lib/python3.6/site-packages/azure/cli/command_modules/storage/__init__.py", line 325, in new_handler
     raise ex
   File "/usr/local/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 688, in _run_job
     result = cmd_copy(params)
   File "/usr/local/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 325, in __call__
     return self.handler(*args, **kwargs)
   File "/usr/local/lib/python3.6/site-packages/azure/cli/core/__init__.py", line 765, in default_command_handler
     return op(**command_args)
   File "/usr/local/lib/python3.6/site-packages/azure/cli/command_modules/storage/operations/blob.py", line 305, in storage_blob_upload_batch
     if_none_match=if_none_match, timeout=timeout)
   File "/usr/local/lib/python3.6/site-packages/azure/cli/command_modules/storage/util.py", line 225, in wrapper
     return True, func(*args, **kwargs)
   File "/usr/local/lib/python3.6/site-packages/azure/cli/command_modules/storage/operations/blob.py", line 281, in _upload_blob
     return upload_blob(*args, **kwargs)
   File "/usr/local/lib/python3.6/site-packages/azure/cli/command_modules/storage/operations/blob.py", line 451, in upload_blob
     return type_func[blob_type]()
   File "/usr/local/lib/python3.6/site-packages/azure/cli/command_modules/storage/operations/blob.py", line 444, in upload_block_blob
     return client.create_blob_from_path(**create_blob_args)
   File "/usr/local/lib/python3.6/site-packages/azure/multiapi/storage/v2018_11_09/blob/blockblobservice.py", line 453, in create_blob_from_path
     count = path.getsize(file_path)
   File "/usr/local/lib/python3.6/genericpath.py", line 50, in getsize
     return os.stat(filename).st_size
 FileNotFoundError: [Errno 2] No such file or directory: '$web'

Expected behavior

Command to finish successfully.

Environment summary

Docker image sha256:55a65eee1172e112a466d82671410fd2b3d1bed4f7c144e4f375dca2f2c7347f for mcr.microsoft.com/azure-cli

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:30
  • Comments:32 (3 by maintainers)

github_iconTop GitHub Comments

12reactions
bacongobblercommented, Aug 4, 2020

add to S174

Hi @yonzhan. Looking at that milestone, it is planned to be released on August 25th (3 weeks from now).

Code complete: 08/19/2020 Build to Cloud Shell: 08/21/2020 Official Release: 08/25/2020

Is that an accurate timeline here? I’m trying to determine whether I should submit a patch to revert back to v2.9.1 or wait for a hotfix, as this is a major blocker for those using Azure Storage for static website hosting.

Thanks!

5reactions
akhilrajmailboxcommented, Aug 5, 2020

The latest azure-cli version have the issue, try to use the old version, it solved the issue for me, I revert back to version: 2.1.0 If you don’t have any specific dependencies on the azure-cli latest version, then I try to use the old version, that may help

for ubuntu 18 : azure-cli=2.1.0-1~bionic

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error from az storage blob upload-batch command in Azure ...
When trying to run this command from an Azure Devops release task. The task is a Azure CLI (Preview) V2 with Powershell core...
Read more >
az storage blob upload-batch but ignore duplicate files
Is there a way to ignore or filter out content that hasn't changed so that I would only upload the new files and...
Read more >
az cmd "account clear" fails after "az storage blob upload-batch"
1 Answer 1 ... You can try running the Azure CLI task with the Fail on Standard Error option unchecked. This could be...
Read more >
Upload Azure Blob Action
This action is a wrapper for the Azure command lines: az storage blob upload | az storage blob upload-batch. If you're having trouble...
Read more >
Bulk upload files to Azure Blob Storage with the Azure CLI
Fortunately, the Azure CLI now has the capability to bulk upload files with the az storage blob upload-batch command. You need to upload ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found