GithubHelp home page GithubHelp logo

itsokov / container-apps-dotnet-eventing Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jeffhollan/container-apps-dotnet-eventing

0.0 0.0 0.0 479 KB

Azure Container App sample for building event driven containers using Azure Service Bus and Azure Event Hubs

C# 31.04% CSS 10.72% HTML 12.51% Dockerfile 2.59% Bicep 43.15%

container-apps-dotnet-eventing's Introduction

Azure Container Apps Event Driven sample (dotnet)

Sample of 2 container apps deployed to an environment. One of them processes and scales based on a queue from Azure Service Bus, the other one processes and scales from events from Azure Event Hubs.

Deployment files are written in Bicep and can be found in the deploy folder. The scale.rules for each is set based on the KEDA scalers.

Both containers are written using the .NET 6 worker template.

The sample includes an Azure Static Web app that will allow you drop messages on the queue or event hub, and stream back the data from the containers in real-time using Azure Web PubSub.

webpubsub screen

Deploy via GitHub Actions (recommended)

The GitHub Actions will deploy an environment that includes both the with-fqdn and with-dapr versions of the solution.

  1. Fork the sample repo
  2. Create the following required encrypted secrets for the sample
Name Value
AZURE_CREDENTIALS The JSON credentials for an Azure subscription. Learn more
RESOURCE_GROUP The name of the resource group to create
PACKAGES_TOKEN A GitHub personal access token with the packages:read scope. Learn more
DEBUG_SITE Set to true for initial deploy. After initial deploy, set to false.
SWA_TOKEN (optional if using the debug and view logs) A GitHub personal access token with the repo scope. This is used by Azure Static Web Apps to generate the secrets and actions for the static web app publish. Can be very short lived (1 day) as only used for initial create. Learn more

Once the solution has deployed, open the resource group and navigate to the create debug-site Azure Static Web App and browse to the URL. You will be presented with a site that will let you send messages securely to the Event Hub and Service Bus queue, and view logs from the containers in real time via Azure Web PubSub.

Deploy via Bicep

You can also deploy the solution at anytime using the Azure CLI.

  1. Clone this repo and navigate to the folder
  2. Run the following CLI command (with appropiate values for $variables)
az group create -n $resourceGroup -l canadacentral
az deployment group create -g $resourceGroup -f ./deploy/main.bicep \
  -p \
  serviceBusImage='ghcr.io/jeffhollan/container-apps-dotnet-eventing/servicebus:main' \
  eventHubImage='ghcr.io/jeffhollan/container-apps-dotnet-eventing/eventhub:main' \
  registry=ghcr.io \
  registryUsername=$githubUsername \
  registryPassword=$githubPackagesToken

container-apps-dotnet-eventing's People

Contributors

jeffhollan avatar

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.