locked
Uploading a directory blob using Python SDK RRS feed

  • Question

  • Hello is it possible to upload a directory using the python SDK? Because it can be done using azure-cli with the command below:

    `az storage blob upload-batch --destination 'static' --source dist/static`

    Everything inside my dist/static folder including files and folders will be uploaded to the 'static' blob container. I was hoping there is same functionality in python for this
    Thursday, November 16, 2017 9:14 AM

Answers

  • Never mind, I know the technique now..

    All you have to do is specify the directory on the `create_blob_from_path` method like `block_blob_service.create_blob_from_path('mycontainer2', 'static2/dean.html', '/usr/src/app/dist/dean.html')`

    • Marked as answer by vikranth s Thursday, November 16, 2017 1:50 PM
    Thursday, November 16, 2017 9:18 AM

All replies

  • Never mind, I know the technique now..

    All you have to do is specify the directory on the `create_blob_from_path` method like `block_blob_service.create_blob_from_path('mycontainer2', 'static2/dean.html', '/usr/src/app/dist/dean.html')`

    • Marked as answer by vikranth s Thursday, November 16, 2017 1:50 PM
    Thursday, November 16, 2017 9:18 AM
  • Thank you for sharing your solution and experience here. It will be greatly beneficial for other community members who have similar questions.

    Do click on "Mark as Answer" on the post that helps you, this can be beneficial to other community members.

    Thursday, November 16, 2017 1:50 PM
  • `block_blob_service.create_blob_from_path('mycontainer2', 'static2/dean.html', '/usr/src/app/dist/dean.html')`

    whatever the structure we are giving here the same can be available in blob :)

    Monday, April 8, 2019 10:23 AM