简体   繁体   中英

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.

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 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM