bombombs
bombombs

Reputation: 593

Upload folder from PC to a storage account container using Azure CLI

Trying to upload a folder from my pc to a container in my storage account. Did some digging around and this is what I have attempted so far.

az storage blob upload-batch --destination {STORAGE_CONTAINER} --account-name {ACCOUNT_NAME} 
--destination-path {STORAGE_CONTAINER_NAME} --source {local_directory}

Most of it is pretty straight forward but I am wondering about what the destination-path is. The following is the information I got from --help, so I am wondering if it is the storage container name?

The destination path that will be prepended to the blob name.

Upvotes: 1

Views: 1203

Answers (1)

Gaurav Mantri
Gaurav Mantri

Reputation: 136146

Most of it is pretty straight forward but I am wondering about what the destination-path is.

destination-path is the virtual folder where your blobs will be uploaded.

For example, let's say you have a blob container named static-content and you want to upload some images inside it but you want those images to go inside images folder inside that container. That's when you will set destination-path to images.

What this script will do is prepend the value of the destination path to the name of the blob. For example, if you are uploading logo.png and the destination-path is set as images, then the name of your blob will be images/logo.png and the blob URL would be https://account.blob.core.windows.net/container/images/logo.png.

Upvotes: 1

Related Questions