This demo is a containerized microservice application consisting of a Node.js web app taking Pizza orders from customers, and an .NET 6 backend for dispatching the order to be made and for getting order status upon customer inqueries. The instruction is for testing locally and deploying to Azure Container Apps platform. This tutorial was created on Windows 11. The command line deployment scripts may vary on different platforms.
The Pizza Order App demo has the following features:
- Browse pizza options on homepage
- Add pizzas to cart on homepage
- Edit shopping cart
- Submit order
- Check oder status by order ID
1. Browse pizza options and add to cart on the homepage

2. Add pizzas to cart on homepage

5. Check oder status by order ID

- Install Docker
- Install Dapr CLI
- Install Azure CLI
- Install Node.js
- Install .NET 6
- Have a working Azure subscription
- Create an Azure Service Bus with Standard sku or above. Create a Topic called order
az servicebus namespace create --name "your_service_bus_name" --resource-group "your_resource_group_name" --sku Standard
az servicebus topic create --name "order" --namespace-name "your_service_bus_name" --resource-group "your_resource_group_name"
- Create an Azure Storage account. Create a new blob container.
az storage account create --name "your_storage_account_name" --resource-group "your_resource_group_name"
az storage container create --name "your_container_name" --account-name "your_storage_account_name" --public-access container
- Create an Application Insights
az extension add -n application-insights
az monitor app-insights component create --app "your_appinsights_name" --location "your_location" --resource-group "your_resource_group_name"
Download this repository to test the code locally.
In /components directory there are two Dapr component files:
- pubsub.yaml
- statestore.yaml
Put your Azure service bus connection string in pubsub.yaml and Azure Storage blob info in statestore.yaml.
dapr init
Change project to the PizzaWeb directory.
Set App Insights connection string environment vairable:
set APPLICATIONINSIGHTS_CONNECTION_STRING="your_appinsights_connectionstring"
Initialize the project:
npm install
Run the service with Dapr side car process:
Run the following command under the dir pizza-microservice-containers/PizzaWeb
dapr run --dapr-http-port 3500 --app-id order-web --components-path ../components_local/ --app-port 3001 -- npm run debug
Web application's entry point is : http://localhost:3000/
Change project to the PizzaOrderProcessor directory.
Set App Insights connection string environment vairable:
set APPLICATIONINSIGHTS_CONNECTION_STRING="your_appinsights_connectionstring"
Initialize the project:
dotnet restore
dotnet build
Run the service with Dapr side car process:
dapr run --dapr-http-port 3600 --app-id order-processor-http --components-path ../components_local/ --app-port 3001 -- dotnet run --project .
The Pizza Demo App should be running locally now. Test by creating orders and checking for order status.
In /aca-dapr-components directory there are two Dapr component files:
- pubsub.yaml
- statestore.yaml
Put your Azure Service Bus connection string in pubsub.yaml and Azure Storage blob container info in statestore.yaml.
- Login using your Azure account
az login
- Select a subscription if your account is associated with multiple subscriptions
az account set --s "your subscription ID"
- Add Azure Container App CLI extenion
az extension add --name containerapp --upgrade
- Register Container App namespace in your subscription
az provider register --namespace Microsoft.App
- Register Log Analytics workspace in your subscription
az provider register --namespace Microsoft.OperationalInsights
- Create environment variables in Command Prompt:
set RESOURCE_GROUP="your resource group name"
set LOCATION="westus"
set CONTAINERAPPS_ENVIRONMENT="your container app environment name"
- Create resource group
az group create --name %RESOURCE_GROUP% --location %LOCATION%
- Create Azure Container App Environment
az containerapp env create --name %CONTAINERAPPS_ENVIRONMENT% --resource-group %RESOURCE_GROUP% --location %LOCATION% --dapr-instrumentation-key your_appinsights_key --logs-workspace-id your_workspace_id
Change directory to /aca-dapr-components
- Deploy session state store
az containerapp env dapr-component set --name %CONTAINERAPPS_ENVIRONMENT% --resource-group %RESOURCE_GROUP% --dapr-component-name statestore --yaml statestore.yaml
- Deploy pubsub
az containerapp env dapr-component set --name %CONTAINERAPPS_ENVIRONMENT% --resource-group %RESOURCE_GROUP% --dapr-component-name pubsub --yaml pubsub.yaml
Assuming container images has been built using the dockerfile in PizzaWeb and pushed to Dockerhub.
az containerapp create --name order-web --resource-group %RESOURCE_GROUP% --environment %CONTAINERAPPS_ENVIRONMENT% --image <your docker hub account>/node-pizza-web-appinsights:latest --target-port 3000 --ingress external --min-replicas 1 --max-replicas 1 --enable-dapr --dapr-app-id order-web --dapr-app-port 3000 --env-vars "APPLICATIONINSIGHTS_CONNECTION_STRING=<your_appinsights_connectionstring>"
Assuming container images has been built using the dockerfile in PizzaWeb and pushed to Dockerhub.
az containerapp create --name order-processor-http --resource-group %RESOURCE_GROUP% --environment %CONTAINERAPPS_ENVIRONMENT% --image <your docker hub account>/dotnet-pizza-backend-appinsights:latest --target-port 80 --ingress external --min-replicas 1 --max-replicas 1 --enable-dapr --dapr-app-id order-processor-http --dapr-app-port 80 --env-vars "APPLICATIONINSIGHTS_CONNECTION_STRING=<your_appinsights_connectionstring>"

