Skip to content

pelithne/cngbg

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cngbg

This application is a demo on how to setup an event driven architecture combining Dapr, Azure OpenAI and Azure Container Apps.

Prerequisites

To run this application you need an Approved Azure OpenAI Azure subscription (Azure Open AI) an and the following tools installed:

Local development

To run the application locally with Docker compose, you need to create a .env file in the root of the repository. This file should contain the following variables:

AZURE_OPENAI_API_MODEL="<your model here>" # e.g. gpt-35-turbo
AZURE_OPENAI_API_ENDPOINT="<your azure openai endpoint here>" 
AZURE_OPENAI_API_KEY="<your azure openai key here>"

AZURE_COMMUNICATION_CONNECTION_STRING="<your azure communication connection string here>" 
AZURE_COMMUNICATION_FROM_ADDRESS="<your azure communication custom domain from address here>"

# for OpenTelemetry Collector (optional, needs to be enabled in the open telemetry collector config)
APPLICATION_INSIGHTS_INSTRUMENTATION_KEY="<your application insights instrumentation key here>"
APPLICATION_INSIGHTS_INGESTION_ENDPOINT="<your application insights ingestion endpoint here(part of the connectionstring)>"

# for OpenTelemetry Azure Exporter (optional)
APPLICATIONINSIGHTS_CONNECTION_STRING="<your application insights connection string here>"

Then you can run the application with the following command:

docker compose build
docker compose up

To clean up the resources created by Docker compose, run the following command:

docker compose down

Deploy to Azure

Please refer to the Hosting Infrastructure documentation for instructions on how to deploy the application to Azure.

Building the container images in Azure

The container images are built with the following commands. The images are stored in the Azure Container Registry. First set the environment variable for the Azure Container Registry name:

$ENV:ACR="<your acr name>" # e.g. acr<yourname>, the nameSuffix parameter from the deployment. 

Then build the images with the following commands:

push-location src
push-location dinner-api
az acr build -g rg-dinner-finder -r $ENV:ACR -t dinner/api:0.1 .
pop-location
push-location ai-processor
az acr build -g rg-dinner-finder -r $ENV:ACR -t dinner/ai-processor:0.1 .
pop-location
push-location frontend
az acr build -g rg-dinner-finder -r $ENV:ACR -t dinner/web-frontend:0.1 .
pop-location
push-location email-sender
az acr build -g rg-dinner-finder -r $ENV:ACR -t dinner/email-sender:0.1 .
pop-location
pop-location

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published