Azure Storage libraries for Python
- Read and write objects and files from Azure Blob storage
- Send and receive messages between cloud-connected applications with Azure Queue storage
- Read and write large structured data with Azure Table storage
- Share storage between apps with Azure File storage
Create, update, and manage Azure Storage accounts and query and regenerate access keys from your Python code with the management libraries.
Install the libraries
Azure Storage Client Libraries consist of 4 packages: Blob, File, Queue and Table. To install the blob package, run:
pip install azure-storage-blob
pip install azure-mgmt-storage
from azure.storage.blob import BlockBlobService blob_service = BlockBlobService(account_name, account_key) blob_service.create_container( 'mycontainername', public_access=PublicAccess.Blob ) blob_service.create_blob_from_bytes( 'mycontainername', 'myblobname', b'<center><h1>Hello World!</h1></center>', content_settings=ContentSettings('text/html') ) print(blob_service.make_blob_url('mycontainername', 'myblobname'))
|Get started with Azure Blob Storage in Python||Create, read, update, restrict access, and delete files and objects in Azure Storage.|
|Get started with Azure Queue Storage in Python||Insert, peek, retrieve and delete messages from Azure Storage queues.|
|Manage Azure Storage accounts||Create, update , and delete storage accounts. Retrieve and regenerate storage account access keys.|
Explore more sample Python code you can use in your apps.