Skip to content
This repository has been archived by the owner on Jan 8, 2024. It is now read-only.

This quick demo shows how to Deploy a Web API using Azure Container Apps and leveraging Dapr actors to keep state

License

Notifications You must be signed in to change notification settings

MSFT-UK-Demo/containerapps-api-techspresso

 
 

Repository files navigation

Azure Container Apps - API & Dapr Actors Sample

This quick demo shows how to host an API using Azure Container Apps. The API invokes Dapr actors hosted on sidecar container. Both the API and Actors runtime are scaled based on number of concurrent HTTP requests

Getting Started

  1. Fork this repository

  2. (optional) Create a Container Apps Environment if no one exists: https://docs.microsoft.com/en-us/azure/container-apps/microservices-dapr?tabs=bash#create-an-environment

  3. Create GitHub secret for

  4. Make a change like adding a comment to a solution file. This will trigger an application deployment through a GitHub workflow. The GitHub workflow uses a bicep template to deploy the Container App as well as a Cosmos DB account for saving actors' state

Trying out the app

  1. Using Postman or an HTTP client make an HTTP POST request to https://(container-app-url)/weatherforecast using this payload:
{
        "date": "2021-07-16T19:04:05.7257911-06:00",
        "temperatureC": 45,
        "temperatureF": 125,
        "summary": "Mild",
        "city": "cairo"
}
  1. Using a browser or an HTTP client make an HTTP Get request to https://(container-app-url)/weatherforecast/cairo. This will return number of data points and highest temperature recorded for this city. Try submitting more POST requests to this city and other cities.

Note: Every city here is represented as a Virtual Actor.

About

This quick demo shows how to Deploy a Web API using Azure Container Apps and leveraging Dapr actors to keep state

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 80.8%
  • Bicep 12.7%
  • Dockerfile 6.5%