Free 40-page Claude guide — setup, 120 prompt codes, MCP servers, AI agents. Download free →
CLSkills
Cloud (AWS/GCP/Azure)intermediate

Blob Storage

Share

Azure Blob Storage operations

Works with OpenClaude

You 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 azure to verify azure-storage-blob is 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

  1. Install the Azure Blob Storage SDK: pip install azure-storage-blob
  2. Set environment variables for AZURE_STORAGE_CONNECTION_STRING or prepare your storage account credentials
  3. Import BlobServiceClient from azure.storage.blob to establish the connection
  4. Create a container client using get_container_client(container_name) method
  5. Upload blobs using blob_client.upload_blob() with overwrite=True to replace existing files
  6. Download blobs using download_blob() and read the stream with .readall() or .chunks()
  7. List blobs in a container using container_client.list_blobs() to iterate through blob properties
  8. Delete blobs using blob_client.delete_blob() and handle ResourceNotFoundError exceptions

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

Quick Info

Difficultyintermediate
Version1.0.0
AuthorClaude Skills Hub
cloudazurestorage

Install command:

curl -o ~/.claude/skills/blob-storage.md https://claude-skills-hub.vercel.app/skills/cloud/blob-storage.md

Related Cloud (AWS/GCP/Azure) Skills

Other Claude Code skills in the same category — free to download.

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.