Skip to content

Sample chat application using Azure Cosmos DB for NoSQL, Azure OpenAI, Azure Container Apps, and Azure Container Registry

License

Notifications You must be signed in to change notification settings

Azure-Samples/chat-csharp-cosmos-db-nosql-openai

Repository files navigation

Chat application with Azure Cosmos DB for NoSQL and Azure OpenAI

This sample chat application answers questions from the user and tracks chat history across conversations.

Screenshot of the application with multiple conversation streams and an active conversation on the seating capacity for a sports stadium.

Quickstart

Use the Azure Developer CLI to get started with this project quickly.

Prerequisites

This template will create infrastructure and deploy code to Azure. If you don't have an Azure Subscription, you can sign up for a free account here. Make sure you have the contributor role in the Azure subscription.

Instructions

  1. Log in to AZD.

    azd auth login

    [!NOTE]
    This is only required once per install.

  2. Initialize the project in the current directory.

    azd init --template chat-csharp-cosmos-db-nosql-openai
  3. Deploy the services to Azure, build your container, and deploy the application.

    azd up

Making changes

If you make changes to the application code, you can run azd deploy to deploy the latest version of your application code.

Development container

A development container is available with .NET 8, Azure CLI, and Azure Developer CLI already pre-installed.

Open in GitHub Codespaces

Technology stack

This application uses ASP.NET Core Blazor and the C# programming language.

Azure services

These services are deployed to Azure

Description
Azure Cosmos DB for NoSQL History and data storage
Azure OpenAI Chat completion
Azure Container Registry Docker container registry
Azure Container Apps Web application host