Path: blob/master/Azure Blob Storage/Azure_Blob_Storage_Upload_files.ipynb
2973 views
Kernel: Python 3
Azure Blob Storage - Upload files
Tags: #azure #datalake #naas #snippet
Author: Alexandre Stevens
Last update: 2023-04-12 (Created: 2023-02-06)
Description: This notebook explains how to upload files to Azure Blob Storage using the Azure Python SDK.
Input
Import libraries
In order to update a file into Azure blob storage in Python, you will need to use the Azure Storage SDK for Python.
In [ ]:
Setup Variables
ACCOUNT_URL: Your account url in azure blob storage, example: 'https://yourproject.blob.core.windows.net'
KEY_ACCOUNT: Your Azure credentials, To get access please follow the procedure here
CONTAINER_NAME: Container name in your Azure project where files will be store
FILE_NAME: Name of the file in your container
UPLOAD_FILE_PATH: File to be uploaded
In [ ]:
Model
Create a BlobServiceClient using the connection string
In [ ]:
Create a ContainerClient
In [ ]:
Output
Upload the file to the container
In [ ]: