Aspire Samples

May 16, 2026 ยท View on GitHub

CI (main)

Samples for Aspire.

Aspire is a developer-first toolset that streamlines integrating front-ends, APIs, containers, and databases with your apps. Learn more about Aspire here.

Browse by scenario

Full-stack JavaScript / TypeScript

SampleWorkload languagesAppHostDeployDescription
Integrating Frontend AppsJavaScript, TypeScriptC# AppHostRun onlyReact, Vue, and Angular frontends integrated with Aspire.
Node + Redis + ViteJavaScript, TypeScriptTypeScript AppHostDocker ComposeExpress API + React/Vite frontend + Redis behind YARP.
Vite + YARP Static FilesJavaScript, TypeScriptTypeScript AppHostDocker ComposeVite frontend served through YARP in run and publish modes.

Polyglot full-stack

SampleWorkload languagesAppHostDeployDescription
Integrating Python AppsPython, JavaScriptC# AppHostRun onlyFastAPI backend + React frontend integrated with Aspire.
Vite + C# + PostgreSQLC#, JavaScript, TypeScriptTypeScript AppHostDocker ComposeReact frontend + C# API + PostgreSQL in a single Aspire app.
Vite + React + FastAPIPython, JavaScript, TypeScriptTypeScript AppHostDocker ComposeReact frontend + FastAPI backend behind YARP.
Polyglot Task QueueJavaScript, Python, C#TypeScript AppHostDocker ComposeReact + Node API + Python/C# workers coordinated through RabbitMQ.
RAG Document Q&APython, JavaScriptTypeScript AppHostRun onlySvelte frontend + FastAPI + Qdrant + OpenAI.

Backend integrations by language

SampleWorkload languagesAppHostDeployDescription
Integrating a Node.js AppJavaScriptC# AppHostRun onlyIntegrates a Node.js backend with Aspire.
Integrating a Go AppGoC# AppHostDocker ComposeBuilds and runs a Go Gin app from a Dockerfile with Aspire.
Go APIGoTypeScript AppHostDocker ComposeGo + chi API with Aspire-managed run and publish flows.
Python FastAPI + PostgreSQLPythonTypeScript AppHostDocker ComposeFastAPI CRUD API wired to PostgreSQL and pgAdmin.
Python OpenAI AgentPythonTypeScript AppHostDocker ComposeFastAPI AI agent sample with OpenAI integration.
Python ScriptPythonTypeScript AppHostRun onlyMinimal Python script sample using a file-based AppHost.

Cloud / AI / event-driven

SampleWorkload languagesAppHostDeployDescription
Azure FunctionsC#C# AppHostAzureIntegrates Azure Functions, ASP.NET Core, and Blazor with Aspire.
Image GalleryC#, JavaScript, TypeScriptC# AppHostAzureUpload and process images with Azure Blob, Queues, SQL, and Container Apps Jobs.
Custom Metrics VisualizationC#C# AppHostRun onlyCollects and visualizes custom metrics with Prometheus and Grafana.
Standalone Aspire dashboardC#C# AppHostRun onlyRuns the Aspire dashboard container against any OpenTelemetry source.

.NET + frontend and platform

SampleWorkload languagesAppHostDeployDescription
Aspire ShopC#C# AppHostRun onlyDistributed e-commerce sample app demonstrating Aspire integration.
HealthChecksUIC#C# AppHostDocker ComposeDemonstrates isolated health endpoints with HealthChecksUI.
Integrating Client AppsC#C# AppHostRun onlyIntegrates Windows Forms and WPF apps with Aspire.
Integrating OrleansC#C# AppHostRun onlyDistributed actor model sample built with Orleans.
Working with Database ContainersC#, SQLC# AppHostRun onlyInitializes and uses PostgreSQL, MongoDB, and SQL Server containers.
Running EF Core MigrationsC#C# AppHostRun onlyRuns Entity Framework Core migrations inside Aspire workflows.
Persisting Data with Volume MountsC#C# AppHostRun onlyDemonstrates data persistence with containers, Azure Storage, and SQL Server.
Custom Aspire hosting resourcesC#C# AppHostRun onlyDemonstrates authoring custom hosting resources with Aspire.

eShop

eShop is a reference application implementing an eCommerce web site on a services-based architecture using Aspire.

License

These samples are licensed under the MIT license.

Disclaimer

The sample applications provided in this repository are intended to illustrate individual concepts that may be beneficial in understanding the underlying technology and its potential uses. These samples may not illustrate best practices for production environments.

The code is not intended for operational deployment. Users should exercise caution and not rely on the samples as a foundation for any commercial or production use.

See the following links for more information on best practices and security considerations when hosting applications:

Contributing

We welcome contributions to this repository of samples related to official Aspire features and integrations (i.e. those pieces whose code lives in the Aspire repo and that ship from the Aspire NuGet account). It's generally a good idea to log an issue first to discuss any idea for a sample with the team before sending a pull request.

Code of conduct

This project has adopted the code of conduct defined by the Contributor Covenant to clarify expected behavior in our community. For more information, see the .NET Foundation Code of Conduct.

Using Devcontainer and Codespaces

This repository includes a devcontainer configuration to help you quickly set up a development environment using Visual Studio Code and GitHub Codespaces.

Setting up Devcontainer

  1. Install Visual Studio Code: If you haven't already, download and install Visual Studio Code.

  2. Install Dev Containers extension: Open Visual Studio Code and go to the Extensions view by clicking on the Extensions icon in the Activity Bar on the side of the window. Search for "Dev Containers" and install the extension.

  3. Clone the repository: Clone this repository to your local machine.

  4. Open the repository in Visual Studio Code: Open Visual Studio Code and use the File > Open Folder menu to open the folder where you cloned this repository.

  5. Reopen in Container: Once the repository is open, you should see a notification prompting you to reopen the folder in a container. Click the "Reopen in Container" button. If you don't see the notification, you can also use the Remote-Containers: Reopen in Container command from the Command Palette (Ctrl+Shift+P).

Using GitHub Codespaces

  1. Open the repository on GitHub: Navigate to this repository on GitHub.

  2. Create a Codespace: Click the "Code" button and then click the "Open with Codespaces" tab. Click the "New codespace" button to create a new Codespace.

  3. Wait for the Codespace to start: GitHub will set up a new Codespace with the devcontainer configuration defined in this repository. This may take a few minutes.

  4. Start coding: Once the Codespace is ready, you can start coding directly in your browser or open the Codespace in Visual Studio Code.

The devcontainer configuration includes all the necessary tools and dependencies to run the samples in this repository. You can start coding and running the samples without having to install anything else on your local machine.