Azure Blob Storage operations
✓Works with OpenClaudeYou are an Azure cloud developer. The user wants to perform common Blob Storage operations including uploading, downloading, listing, and deleting blobs using the Azure SDK for Python.
What to check first
- Run
pip list | grep azureto verifyazure-storage-blobis installed (version 12.x or higher) - Confirm your Azure Storage Account name and connection string are available in environment variables or configuration
- Check that your storage container exists in the Azure portal or create one via Azure CLI:
az storage container create --name mycontainer --account-name mystorageaccount
Steps
- Install the Azure Blob Storage SDK:
pip install azure-storage-blob - Set environment variables for
AZURE_STORAGE_CONNECTION_STRINGor prepare your storage account credentials - Import
BlobServiceClientfromazure.storage.blobto establish the connection - Create a container client using
get_container_client(container_name)method - Upload blobs using
blob_client.upload_blob()withoverwrite=Trueto replace existing files - Download blobs using
download_blob()and read the stream with.readall()or.chunks() - List blobs in a container using
container_client.list_blobs()to iterate through blob properties - Delete blobs using
blob_client.delete_blob()and handleResourceNotFoundErrorexceptions
Code
from azure.storage.blob import BlobServiceClient, BlobClient, ContainerClient
from azure.core.exceptions import ResourceNotFoundError
import os
# Initialize the BlobServiceClient
connection_string = os.getenv("AZURE_STORAGE_CONNECTION_STRING")
blob_service_client = BlobServiceClient.from_connection_string(connection_string)
class AzureBlobStorageManager:
def __init__(self, connection_string: str, container_name: str):
self.blob_service_client = BlobServiceClient.from_connection_string(connection_string)
self.container_name = container_name
self.container_client = self.blob_service_client.get_container_client(container_name)
def upload_blob(self, blob_name: str, data: bytes, overwrite: bool = True) -> str:
"""Upload data to a blob."""
blob_client = self.container_client.get_blob_client(blob_name)
blob_client.upload_blob(data, overwrite=overwrite)
return blob_client.url
def upload_blob_from_file(self, blob_name: str, file_path: str, overwrite: bool = True) -> str:
"""Upload a file to blob storage."""
with open(file_path, "rb") as data:
blob_client = self.container_client.get_blob_client(blob_name)
blob_client.upload_blob(data, overwrite=
Note: this example was truncated in the source. See the GitHub repo for the latest full version.
Common Pitfalls
- Treating this skill as a one-shot solution — most workflows need iteration and verification
- Skipping the verification steps — you don't know it worked until you measure
- Applying this skill without understanding the underlying problem — read the related docs first
When NOT to Use This Skill
- When a simpler manual approach would take less than 10 minutes
- On critical production systems without testing in staging first
- When you don't have permission or authorization to make these changes
How to Verify It Worked
- Run the verification steps documented above
- Compare the output against your expected baseline
- Check logs for any warnings or errors — silent failures are the worst kind
Production Considerations
- Test in staging before deploying to production
- Have a rollback plan — every change should be reversible
- Monitor the affected systems for at least 24 hours after the change
Related Cloud (AWS/GCP/Azure) Skills
Other Claude Code skills in the same category — free to download.
Lambda Function
Create AWS Lambda function with handler
S3 Operations
Set up S3 bucket operations (upload, download, presigned URLs)
DynamoDB CRUD
Create DynamoDB CRUD operations
SQS Setup
Set up SQS queue producer and consumer
SNS Notifications
Configure SNS for push notifications
CloudFront Setup
Set up CloudFront CDN distribution
Cognito Auth
Implement AWS Cognito authentication
RDS Setup
Configure RDS database connection
Want a Cloud (AWS/GCP/Azure) skill personalized to YOUR project?
This is a generic skill that works for everyone. Our AI can generate one tailored to your exact tech stack, naming conventions, folder structure, and coding patterns — with 3x more detail.