Search code examples
azureazure-blob-storageazure-storage

Upload all the contents of a directory to the storage account container


I have the following structure

mf
├── dir1
│   └── file1
├── file1
├── file2
├── file3
├── file4
└── file5

Is it possible to upload only the content that is inside the mf folder by az cli commands to a storage account container?


Solution

  • I have reproduced in my environment and got expected results as below and I followed Microsoft-Document:

    Firstly, I have :

    enter image description here

    Then used :

    az storage blob upload-batch --destination "name of container" --account-name "rithwik"  --source "C:\Users\Downloads\mf"
    

    enter image description here

    After Uploading:

    enter image description here

    If you want it in same structure with mf :

    az storage blob upload-batch --destination "rithwik" --account-name "rithwik" --destination-path mf --source "C:\Users\Downloads\mf"
    

    enter image description here

    In Azure Portal:

    enter image description here

    Inside mf:

    enter image description here

    Inside dir1:

    enter image description here