I have an image directory named images which contains image files as:
images
--0001.png
--0002.jpg
--0003.png
Now I want to upload this directory to my azure blob storage with the same file structure. I looked at the sample code given here and here but:
azure-blob-storage, there is no such thing as BlobService in that package.It's in the documentation that you linked.
It's not BlobService, it is BlobClient class.
from azure.storage.blob import BlobClient
blob_client = BlobClient.from_connection_string(
conn_str='my_conn_str',
container_name='my_container_name',
blob_name='my_blob_name')
with open("./SampleSource.txt", "rb") as data:
blob.upload_blob(data)
See the BlobClient.from_connection_string documentation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With