Skip to content

petabridge/azure-container-app-akkadotnet

Repository files navigation

Akka.NET: Shopping Cart App

A canonical shopping cart sample application, built using Akka.NET. This app shows the following features:

  • Shopping cart: A simple shopping cart application that uses Akka.NET for its cross-platform framework support, and its scalable distributed applications capabilities.

    • Inventory management: Edit and/or create product inventory.
    • Shop inventory: Explore purchasable products and add them to your cart.
    • Cart: View a summary of all the items in your cart, and manage these items; either removing or changing the quantity of each item.

Shopping Cart sample app running.

Features

The app is architected as follows:

Shopping Cart sample app architecture.

Get Started

Prerequisites

Quickstart

  1. git clone [email protected]:petabridge/azure-container-app-akkadotnet.git akka-on-container-apps
  2. cd akka-on-container-apps
  3. dotnet run --project src\Akka.ShoppingCart\Akka.ShoppingCart.csproj

Deploying To Azure Container Apps

Create a Resource Group

Before deploying the app, you need to create an Azure Resource Group (or you could choose to use an existing one). To create a new Azure Resource Group, use one of the following articles:

Prepare For Azure Deployment

In this tutorial, we will be using Azure CLI and Azure Bicep to create all of the resources needed by the example project and to deploy the Docker container into Azure Container Apps.

Provision Required Azure Resources

We will use PowerShell, Azure CLI, and the provided .bicep files to automate our Azure resource creation. A convenience PowerShell script deploy.ps1 is available to deploy the whole stack in one go.

The deploy.ps1 file will:

  • Prompt you for a unique name for your Azure Container Apps
  • Prompt you for the Azure Resource Group to deploy to
  • Prompt you for the location to deploy the resources
  • Launch az login for you to log in to your Azure account
  • Flex the acr.bicep file to deploy an Azure Container registry
  • Login Docker to Azure Container Registry
  • Builds a Docker image for the sample project
  • Push the Docker image to Azure Container registry
  • Flex the main.bicep file to provision:
    • Azure Storage account
    • Azure Application Insight
    • Azure Log Analytics workspace
    • Azure Container Apps Environment
    • Azure Container App

Explore The Bicep Templates

The Bicep files used in this example is nearly identical to the one used in the Orleans example.

To read more about the Bicep files and how they are used in resource provisioning, please read the documentation.

Acknowledgements

The Akka.ShoppingCart project uses the following 3rd party open-source projects:

  • MudBlazor: Blazor Component Library based on Material design.
  • Bogus: A simple fake data generator for C#, F#, and VB.NET.
  • Blazorators: Source-generated packages for Blazor JavaScript interop.

Derived from: