Giter Club home page Giter Club logo

dapr-container-apps-demo's Introduction

DAPR Container Apps in Azure

Learning Azure Container Apps based on this guide from Microsoft

This repo contains code to deploy the Dapr hello-world application on Azure Container Apps with Dapr using Azure Storage Account for storing state.

Technologies

  • ๐Ÿ”จ Azure PowerShell for interaction with Azure
  • โš™๏ธ PowerShell for deployment script
  • ๐Ÿ’ช Bicep for Infrastructure as Code

Overview

diagram (diagram by Microsoft - CC BY 4.0)

Usage

Prerequisites

  1. Install/update Azure PowerShell module (Tested with Az 6.15.0)
  2. Install/update Bicep CLI (Tested with 0.25.53)
  3. Connect to Azure: Connect-AzAccount
  4. Set Context: Set-AzContext -SubscriptionName <subscription name>
  5. Register resource provider: Register-AzResourceProvider -ProviderNamespace Microsoft.App

Deploy

Open PowerShell and run deploy.ps1 to deploy the resources:

./deploy.ps1

# Example output
๐Ÿš€ Deploying container apps...(this will take a few minutes)

โœ”๏ธ  Deploy succeeded! API url:
https://nodeapp.<unique name>.canadacentral.azurecontainerapps.io/order

โŒ› Waiting for a minute before querying api and logs...

๐Ÿ”Ž Querying /order API...
{
  "orderId": 99
}

๐Ÿ—’๏ธ  Querying logs from Log Analytics Workspace. Listing 5 latest entries...
[
  {
    "ContainerAppName_s": "nodeapp",
    "Log_s": "Got a new order! Order ID: 83",
    "TimeGenerated": "2022-05-20T21:36:37.839Z"
  },
  {
    "ContainerAppName_s": "nodeapp",
    "Log_s": "Got a new order! Order ID: 84",
    "TimeGenerated": "2022-05-20T21:36:37.839Z"
  },
  {
    "ContainerAppName_s": "nodeapp",
    "Log_s": "Got a new order! Order ID: 85",
    "TimeGenerated": "2022-05-20T21:36:39.674Z"
  },
  {
    "ContainerAppName_s": "nodeapp",
    "Log_s": "Got a new order! Order ID: 60",
    "TimeGenerated": "2022-05-20T21:36:13.533Z"
  },
  {
    "ContainerAppName_s": "nodeapp",
    "Log_s": "Got a new order! Order ID: 64",
    "TimeGenerated": "2022-05-20T21:36:17.643Z"
  }
]

Clean up resources

The services deployed are designed for demo purposes and they are quite chatty, which will result in Azure cost (mostly compute, logging, storage). Around $2-$3 daily.

To clean up resources run the following command:

Remove-AzResourceGroup -Name dapr-containerapps-demo -Force

Notice

The steps needed for this demo are closely based on this guide from Microsoft. The deployment logic and Bicep templates have been updated by me to fit an end-to-end demo deployment scenario and to use latest versions of tooling/providers.

The application deployed is the Dapr hello-world application.

dapr-container-apps-demo's People

Contributors

matsest avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

ractando

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.