- Option 1: Build and run with GitHub Codespaces (recommended)
- Option 2: Build and run with VS Code Dev Containers
- Option 3: Build and run with VS Code directly
- Option 4: Build and run manually
- A GitHub account with access to GitHub Codespaces
- Select Code and open in Codespace from GitHub
- After the codespaces has initialized, select to debug and run All Containers to run the sample locally
- Docker (with docker-compose)
- VS Code with the remote containers extension installed
- Fork the sample repo
- Clone the repo:
git clone https://github.com/{username}/container-apps-store-api-microservice
- Open the cloned repo in VS Code
- Follow the prompt to open in a dev container
- Select the debug All Services and run the sample locally
Any changes made to the project and checked into your GitHub repo will trigger a GitHub action to build and deploy
- VS Code with the recommended extensions installed
- Node.js
- Python 3.x
- Go
- Dapr
- Azure CLI
- Azure Container Apps CLI extension
- Fork the sample repo
- Clone the repo:
git clone https://github.com/{username}/container-apps-store-api-microservice
- Open the cloned repo in VS Code
- Follow the prompt to install recommended extensions
- Select the debug All Services and run the sample locally
Any changes made to the project and checked into your GitHub repo will trigger a GitHub action to build and deploy
- Fork the sample repo
- Clone the repo:
git clone https://github.com/{username}/container-apps-store-api-microservice
- Build the sample:
cd node-service
npm install
cd ../go-service
go install
cd ../python-service
pip install -r requirements.txt
cd ..
- Run the sample
Dapr will be used to start microservices and enable APIs for things like service discovery and state management. The code for store-api
service invokes other services at the localhost:daprport host address, and sets the dapr-app-id
HTTP header to enable service discovery using an HTTP proxy feature.
Run the node-app
(store-api) service in a new terminal window:
dapr run --app-id node-app --app-port 3000 --dapr-http-port 3501 --components-path ./dapr-components -- npm run start
Run the python-app
(order) service in a new terminal window:
dapr run --app-id python-app --app-port 5000 --dapr-http-port 3500 --components-path ./dapr-components -- python3 app.py
Run the go-app
(inventory) service in a new terminal window:
dapr run --app-id go-app --app-port 8050 --dapr-http-port 3502 --components-path ./dapr-components -- go run .
State management
: orders app calls the Dapr State Store APIs which are bound to a Redis container that is preinstalled with Dapr. When the application is later deployed to Azure Container Apps, the component config yaml will be modified to point to an Azure CosmosDb instance. No code changes will be needed since the Dapr State Store API is completely portable.