Skip to content
Star
478
Star
478

Storage Writer

This guide shows you how to work with Azure Functions locally using Azurite, Docker Compose, and Python. This lab demonstrates how to create an HTTP-triggered function that uploads files to Azurite blob storage.

  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. Start Infrastructure: Launch the Azurite container:

    Terminal window
    docker compose up -d
  3. Start Function Host:

    Terminal window
    func start --prefix ./upload-function/
  4. Run the Example:

    Terminal window
    python main.py

Check using Azure Storage extension:

  • Open: Open the Azure view in VS Code (Azure icon in the sidebar).
  • Connect: Under Storage Accounts, click Attach Storage Account > Attach to a local emulator.
  • Browse: Use the default Azurite connection settings to browse your containers and blobs visually.
Terminal window
docker compose down -v
IssueSolution
Connection RefusedEnsure Azurite is running: docker ps
Module Not FoundReinstall function dependencies: cd upload-function && pip install -r requirements.txt