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`: cannot upload directories to $root container

See original GitHub issue

Environment summary

OS: macOS 10.13 CLI version: 2.0.20 via Homebrew Shell: zsh

I’m attempting to upload a directory with sub directories to the root container using this syntax:

az storage blob upload-batch -d 'https://MY_STORAGE_ACCOUNT.blob.core.windows.net/$root' -s build

I get the following error when it attempts to upload the first sub directory and the command fails:

The requested URI does not represent any resource on the server.

I have tried using other syntax variants such as the one below and I get the same error:

az storage blob upload-batch -d '$root' -s build --account-name MY_STORAGE_ACCOUNT

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
saggy6210commented, Feb 15, 2018

I am not able to upload directory content using az storage file upload-batch Below command is failing with mentiond issue. What is the share_name and what value need to provide for it? az storage file upload-batch --destination <Container-URL> --source <directory-name> --account-name <storage-account-name> --account-key <storage-account-key> uploading <directory-path><file-name> share_name should not be None.

1reaction
derekbekoecommented, Oct 27, 2017

@sethdeckard you can achieve this by combining the root container with non-root containers. e.g.

$root/index.html
assets/style.css
assets/main.js
assets/sub_dir/example.ts

For example, use $root for your index file and have an ‘assets’ container then you can batch upload to that assets container. If you need more subdirectories under assets, the files in that container can use slashes (‘sub_dir/example.ts’ would be the file name for example).

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to upload a folder to Blob Storage? - azure - Stack Overflow
You can use upload-batch : az storage blob upload-batch --destination ContainerName --account-name YourAccountName --destination-path ...
Read more >
Can't upload-batch to storage account - MSDN - Microsoft
The web service endpoint returns the index document in the requested directory for both the root and all sub directories. For more information, ......
Read more >
Transferring file directory/folder to Azure Blob Storage with ...
You might have faced the issue that you cannot transfer a whole directory of files manually into a storage account in Azure UI....
Read more >
How to host your static website in Azure Storage
I'm going to use Azure CLI to upload the content of my current terminal folder to blob storage using the following command: az...
Read more >
[Solved]-How to upload a folder to Azure storage-C#
GetBlockBlobReference(cloudfileName); blob.UploadFromFile(file); }. Niels 1006. score:0. From the CLI you can use: az storage blob upload-batch.
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