I'm using python 3.6 in visual studio and I want to download all blobs files from my azure container in single folder. This is my code but the problem is, that it downloads 1 blob file in the folder and then when downloading the second file it overwrite the first file and in the end I only have the last blob in my local folder. How can I download all the blobs files at once in a single folder?
from azure.storage.blob import BlockBlobService
block_blob_service = BlockBlobService(account_name=ACCOUNT_NAME, account_key=ACCOUNT_KEY)
generator = block_blob_service.list_blobs(CONTAINER_NAME)
for blob in generator:
block_blob_service.get_blob_to_path(CONTAINER_NAME, blob.name, LOCAL_FILE)
get_blob_to_path()
method isn't going to append to files. – Marcinopen_mode='ab'
toget_blob_to_path
? – Farthermost