Skip to content

About

Aspire + JupyterLab & PySpark local development environment

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

PySpark Aspire

Aspire + JupyterLab & PySpark

Combining the power and elegance of the Aspire framework with JupyterLab & PySpark for fast, no‑friction development and testing.


πŸš€ Project Goals

  • Combine Aspire + JupyterLab: Provide a simple, quick, no‑friction local dev experience by combining Aspire with JupyterLab notebooks.

  • Pre‑loaded Azure libraries: Ship a local environment with PySpark and the Azure SDK for Python available out of the box so you can prototype quickly.

  • Local Azure Blob integration: Provide easy local Blob storage via the official Azurite emulator.

  • Local Cosmos DB integration: Provide easy local Cosmos DB via the official Cosmos DB (Preview) emulator.

  • Local Kafka, Kafka Connect, Schema Registry etc.

  • Deployment readiness: While this project focuses on local development, the same notebooks can be adapted for deployment to Azure Synapse or Microsoft Fabric environments.


πŸ“‹ Prerequisites

  • Install .NET 10 SDK (required to build/run Aspire components).
    πŸ‘‰ Download .NET SDK
  • Install the latest Aspire framework as per the Aspire documentation.
  • Docker (for building and running the custom container).
  • (Optional) Azure Storage Explorer β€” recommended for copying files into Azurite.
    πŸ‘‰ Download Storage Explorer

πŸ“‚ Files & Folders of Interest

  • data/hr.csv β€” sample HR data used by Azurite-Sample.ipynb notebook.
  • pyspark-notebooks/ β€” project notebooks; this folder is mapped into JupyterLab for convenience.

🐳 Build the Docker Image

From the repository root, build the custom container used for the JupyterLab + PySpark + Azure SDK environment:

docker build -t pyspark-azure-notebook .

▢️ Run Aspire (Start Aspire, Azurite & JupyterLab)

This project leverages the Aspire framework to orchestrate your local development environment.
Follow these steps to get everything running smoothly:

  1. πŸ“¦ Restore dependencies

    dotnet restore
  2. πŸ“¦ Build the Aspire project

    dotnet build
  3. πŸ“¦ Run Aspire

    aspire run

πŸš€ What Happens When You Run Aspire

Running aspire run will:

  • 🌐 Launch the Aspire application and open the Aspire Dashboard in your browser.
  • πŸ“¦ Start the local Azurite & Cosmos DB emulators automatically.
  • πŸ“’ Spin up the Kafka, Kafka Connect, Schema Registry containers.
  • πŸ“’ Spin up the JupyterLab container.

πŸ“₯ Load Sample Data into Azurite

After Aspire has started:

  1. πŸ”— Use Azure Storage Explorer (recommended) to connect to the local Azurite instance.
  2. πŸ“‚ Copy data/hr.csv into a container named data.
  3. βœ… Your notebooks can now access blobs directly from Azurite for testing and prototyping.

πŸ“ Notes & Recommendations

  • πŸ“’ Project notebooks: The pyspark-notebooks folder is bound to JupyterLab at /home/jovyan/work for convenience β€” edit locally and work in Jupyter seamlessly.
  • πŸ“‚ Data mounting: The data/ folder lets notebooks read data/hr.csv directly or access blobs through the Azurite endpoint.
  • 🌐 Azurite endpoint: If you need the blob endpoint URL for notebooks, it will typically be: http://azure-storage:10000

Configure your connection strings in notebooks to point to this endpoint when running against Azurite.


βœ… Quick Checklist

  • πŸ”§ [.NET 10 SDK installed]
  • πŸ—οΈ [Aspire framework installed]
  • 🐳 [Build Docker image with docker build -t pyspark-azure-notebook .]
  • πŸ“¦ [Copy data/hr.csv into a data container using Azure Storage Explorer]

About

Aspire + JupyterLab & PySpark local development environment

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages