Skip to content
Star
478
Star
478

Blob Storage

This guide shows you how to work with Azure Blob Storage locally using Azurite, Docker Compose, and Python. This lab demonstrates how to create containers and upload and download blobs.

  1. Setup Environment:

    Open VS Code in the project folder and execute this command in the Command Palette:

    Terminal window
    > Dev Containers: Reopen in Container
  2. Run the Example:

    Terminal window
    python main.py
  1. Python Script (main.py):
    • Open: Open main.py in VS Code.
    • Run: Use the Python: main.py configuration in the Run and Debug tab.
  • All tests: Run the automated script: scripts/run_tests.sh
  • Individually: Use the VS Code Testing tab to run or debug specific test cases.

Connect the Azure Storage extension to your running Azurite to browse containers and blobs visually.

  1. Open: Open the Azure view in VS Code (Azure icon in the sidebar).
  2. Attach: Under Storage Accounts, click Attach Storage Account > Attach to a local emulator and accept the defaults (account devstoreaccount1).
  3. Browse: Expand Local Emulator > Blob Containers to see test-container and hello.txt.
Terminal window
docker compose down -v
IssueSolution
Port 10000 in useAnother Azurite is bound to it. Stop the VS Code Azurite extension emulator (> Azurite: Close) or the other container before starting.
Connection RefusedEnsure Azurite is running: docker ps
Module Not FoundReinstall dependencies: scripts/setup.sh
azurite.skipApiVersionCheck is not a registered configurationREST API-version mismatch. The lab already starts Azurite with --skipApiVersionCheck; recreate it with docker compose up -d azurite, then reload the window (> Developer: Reload Window).
Storage Account devstoreaccount1 is already attachedIt is already connected. Locate the existing Local Emulator node and Refresh it instead of re-attaching.