Created
January 16, 2022 22:45
-
-
Save RachidAZ/106f578d91b02f78629e2e65e8ae83ec to your computer and use it in GitHub Desktop.
upload file as a blob to Azure storage account using python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from azure.storage.blob.aio import BlobClient | |
account_name = "{account_name}" | |
target_conn_str = "{connection_string}" | |
target_container_name = "{container_name}" | |
target_blob_name = "{file_to_upload}" | |
blob = BlobClient.from_connection_string(conn_str=target_conn_str, container_name=target_container_name, blob_name= target_blob_name) | |
with open(target_blob_name, "rb") as data: | |
await blob.upload_blob(data) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment