In today's digital communication landscape, the demand for AI-powered chatbots and real-time streaming technology is rapidly growing. Companies, small and large, are experimenting with how to leverage AI to streamline workflow, increase productivity and offer differientiated products and services to their customers. This project brings these trends together by integrating SignalR for real-time group chat functionality with Azure OpenAI's AI capabilities. It showcases how to create a seamless group chat experience using SignalR for real-time communication, enhanced by the intelligence of Azure OpenAI. Such experience is already available to Microsoft Teams users.
This template, the application code and configuration it contains, has been built to showcase Microsoft Azure specific services and tools. We strongly advise our customers not to make this code part of their production environments without implementing or enabling additional security features.
Features • Gettting Started • Guidance
This project provides the following features:
- Group chat with or without AI assistant
- Stream to all users in a group chat using Azure SignalR service
- Generate context-aware responses using Azure OpenAI
You have a few options for getting started with this template. The quickest way to get started is GitHub Codespaces, since it will setup all the tools for you, but you can also set it up locally. You can also use a VS Code dev container
This template uses gpt-4o
which may not be available in all Azure regions. Check for up-to-date region availability and select a region during deployment accordingly. We recommend using [East US]
You can run this template virtually by using GitHub Codespaces. The button will open a web-based VS Code instance in your browser:
- Open the template (this may take several minutes)
- Open a terminal window
- Continue with the Deploying steps
A related option is VS Code Dev Containers, which will open the project in your local VS Code using the Dev Containers extension:
- Start Docker Desktop (install it if not already installed)
- Open the project:
- In the VS Code window that opens, once the project files show up (this may take several minutes), open a terminal window.
- Continue with the Deploying steps
- .Net 8 SDK
- Install azd
- Windows:
winget install microsoft.azd
- Linux:
curl -fsSL https://aka.ms/install-azd.sh | bash
- MacOS:
brew tap azure/azd && brew install azd
- Windows:
- Docker Desktop
- This template uses "gpt-4o" which may not be available in all Azure regions. Check for up-to-date region availability and select a region during deployment accordingly
- We recommend using [East US]
- Download the project code:
az init -t signalr-ai-streaming
- Continue with the Deploying steps
Once you've opened the project in Codespaces, in Dev Containers, or locally, you can deploy it to Azure.
- Login to Azure:
azd auth login
- Provision resources and deploy the app to Azure Container App:
azd up
It will prompt you to provide an azd environment name (like "chat-app"), select a subscription from your Azure account, and select a location where OpenAI is available (like "eastus"). Then it will provision the resources in your account and deploy the latest code. If you get an error or timeout with deployment, changing the location can help, as there may be availability constraints for the OpenAI resource.
-
When azd has finished deploying, you'll see an endpoint URI in the command output. Visit that URI, and you should see the chat app!
-
When you've made any changes to the app code, you can just run:
azd deploy
This project includes a Github workflow for deploying the resources to Azure on every push to main. That workflow requires several Azure-related authentication secrets to be stored as Github action secrets. To set that up, run:
azd pipeline config
This template uses "gpt-4o" which may not be available in all Azure regions. Check for up-to-date region availability and select a region during deployment accordingly
- We recommend using [East US]
You can estimate the cost of this project's architecture with Azure's pricing calculator
- [Azure Product] - [plan type] link to pricing for product
Note
When implementing this template please specify whether the template uses Managed Identity or Key Vault
This template has either Managed Identity or Key Vault built in to eliminate the need for developers to manage these credentials. Applications can use managed identities to obtain Microsoft Entra tokens without having to manage any credentials. Additionally, we have added a GitHub Action tool that scans the infrastructure-as-code files and generates a report containing any detected issues. To ensure best practices in your repo we recommend anyone creating solutions based on our templates ensure that the Github secret scanning setting is enabled in your repos.