Home

Awesome

eShop Reference Application - "AdventureWorks"

A reference .NET application implementing an e-commerce website using a services-based architecture using .NET Aspire.

eShop Reference Application architecture diagram

eShop homepage screenshot

Getting Started

Prerequisites

Windows with Visual Studio

Or

install-Module -Name Microsoft.WinGet.Configuration -AllowPrerelease -AcceptLicense -Force
$env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User")
get-WinGetConfiguration -file .\.configurations\vside.dsc.yaml | Invoke-WinGetConfiguration -AcceptConfigurationAgreements

Or

Mac, Linux, & Windows without Visual Studio

dotnet workload update
dotnet workload install aspire
dotnet restore eShop.Web.slnf

Or

Install Visual Studio Code and related extensions
install-Module -Name Microsoft.WinGet.Configuration -AllowPrerelease -AcceptLicense  -Force
$env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User")
get-WinGetConfiguration -file .\.configurations\vscode.dsc.yaml | Invoke-WinGetConfiguration -AcceptConfigurationAgreements

Note: These commands may require sudo

Note: When running on Mac with Apple Silicon (M series processor), Rosetta 2 for grpc-tools.

Running the solution

[!WARNING] Remember to ensure that Docker is started

dotnet run --project src/eShop.AppHost/eShop.AppHost.csproj

then look for lines like this in the console output in order to find the URL to open the Aspire dashboard:

Login to the dashboard at: http://localhost:19888/login?t=uniquelogincodeforyou

You may need to install ASP.NET Core HTTPS development certificates first, and then close all browser tabs. Learn more at https://aka.ms/aspnet/https-trust-dev-cert

Azure Open AI

When using Azure OpenAI, inside eShop.AppHost/appsettings.json, add the following section:

  "ConnectionStrings": {
    "OpenAi": "Endpoint=xxx;Key=xxx;"
  }

Replace the values with your own. Then, in the eShop.AppHost Program.cs, set this value to true

bool useOpenAI = false;

Here's additional guidance on the .NET Aspire OpenAI component.

Use Azure Developer CLI

You can use the Azure Developer CLI to run this project on Azure with only a few commands. Follow the next instructions:

azd auth login
azd init
azd up

Notes:

Contributing

For more information on contributing to this repo, read the contribution documentation and the Code of Conduct.

Sample data

The sample catalog data is defined in catalog.json. Those product names, descriptions, and brand names are fictional and were generated using GPT-35-Turbo, and the corresponding product images were generated using DALL·E 3.

Other eShops

For a closely related version of this app that is not Azure specific, please view the dotnet/eShop repo. These two repos share some common code.