Skip to content

Python script that uploads, lists, and downloads CSV files using Azure Blob Storage. Includes screenshots of Azure setup and a small end‑to‑end data pipeline.

Notifications You must be signed in to change notification settings

equicktruth-ctrl/azure-blob-uploader

Repository files navigation

Azure Blob Uploader Demo

Created by Erik Vigorito

Small Python project that shows how to upload, list, and download files from Azure Blob Storage using a storage account created in the Azure portal.

Project Overview

This project was completed by Erik Vigorito as part of a data engineering course. This repo demonstrates a simple data engineering pattern:

  • Create an Azure Storage account and a blob container.
  • Use the Azure Storage Blob SDK for Python to:
    • Upload a local CSV file to Azure Blob Storage.
    • List blobs in a container.
    • Download the blob back to the local machine to verify the round trip.

The project is based on the official Azure Blob Storage Python quickstart and client library documentation.

Tech Stack

  • Python 3.14.0
  • Azure Storage account (Blob Storage)
  • Azure Storage Blob SDK for Python (azure-storage-blob)
  • Visual Studio Code

Repository Structure

  • azure_blob_demo.py – Main script that connects to Azure Blob Storage, creates/uses a container, uploads a CSV, lists blobs, and downloads the file.
  • test_small.csv – Small example CSV used to test the upload/list/download pipeline.
  • downloaded_test_small.csv – File downloaded from Azure (created when the script runs).
  • 01_azure_account.png – Screenshot of the storage account overview page in the Azure portal.
  • 02_pip_install.png – Screenshot of installing the Azure Blob SDK in the terminal.
  • 03_script_run.png – Screenshot of a successful script run in the terminal.
  • 04_azure_portal.png – Screenshot of the container and blob in the Azure portal.

Prerequisites

  • Azure subscription with a storage account and a container created in the portal.
  • Python 3.14.0 installed on your machine.
  • pip available in your PATH.
  • Visual Studio Code (or any editor).

Setup

  1. Clone this repository:

git clone git remote add origin https://github.com/equicktruth-ctrl/azure-blob-uploader.git

cd azure-blob-uploader

  1. Install dependencies:

python -m pip install --upgrade pip python -m pip install azure-storage-blob

  1. Create and update a .py script:
  • Open azure_blob_demo.py.
  • Set these variables at the top of the file:
    account_name = "YOUR_STORAGE_ACCOUNT_NAME"
    account_key = "YOUR_STORAGE_ACCOUNT_KEY"
    sample_file = "test_small.csv"
    
  • The account_name and account_key come from the Azure portal under Storage account → Security + networking → Access keys.
  1. Make sure test_small.csv exists in the project folder (or change sample_file to another CSV file name that exists locally).

How to Run

From the project folder:

python azure_blob_demo.py

The script will:

  1. Connect to Azure Blob Storage using the account name and key.
  2. Create or reuse a container named annotation-data.
  3. Upload test_small.csv or your sample_file to the container as a blob.
  4. List blobs in the container and print their names.
  5. Download the blob as downloaded_test_small.csv to verify the content.

Expected console output is similar to:

  • “Container 'annotation-data' already exists. Using existing container.”
  • “File 'test_small.csv' uploaded to Azure Blob Storage.”
  • “File in container: test_small.csv”
  • “File downloaded as 'downloaded_test_small.csv'.”
  • “Azure Blob demo complete—upload, list, download successful!”

Screenshots

  • 01_azure_account.png – Storage account overview page after successful deployment.
  • 02_pip_install.png – Installing azure-storage-blob with pip.
  • 03_script_run.png – Terminal output from running azure_blob_demo.py.
  • 04_azure_portal.png – Azure portal view of the annotation-data container and uploaded blob.

These images document the full workflow from Azure setup to running the Python script.

Notes and Future Improvements

  • The script currently uses an account key for simplicity; in production, use Azure AD and managed identities for more secure authentication.
  • As a next step, this uploader could be integrated into a larger data pipeline (e.g., reading CSVs from blob storage into a data warehouse or notebook for analysis).

Author

Erik Vigorito

About

Python script that uploads, lists, and downloads CSV files using Azure Blob Storage. Includes screenshots of Azure setup and a small end‑to‑end data pipeline.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages