- download
VSCode
from the following URL - https://code.visualstudio.com/download - download
GIT
from the following URL - https://git-scm.com/downloads - download
Node.js
from the following URL - https://nodejs.org/en - download
.NET 8
from the following URL - https://dotnet.microsoft.com/en-us/download/dotnet/8.0 - Install
Azure CLI
from the following URL - https://learn.microsoft.com/en-us/cli/azure/install-azure-cli - Install
Azure Functions Core Tool
from the following URL - https://learn.microsoft.com/en-us/azure/azure-functions/functions-run-local?tabs=windows%2Cisolated-process%2Cnode-v4%2Cpython-v2%2Chttp-trigger%2Ccontainer-apps&pivots=programming-language-csharp
This full stack web application is built to provide a working proof of concept of the Copilot Stack
that talks about how you can, as a developer, build your own custom copilot experience just like Microsoft Copilot.
The web application is built with React
as the frontend nd the backend is written in C#
programming langauge. The web application integrates Semantic Kernel
with a lot of other Azure Cloud-based offerings such as Azure functions, Cosmos DB for NoSQL, Azure AI Search for RAG (Retrieval Augmented Generation), Microsoft Grpah Plugin, Web Searcher Plugin and a bunch of other Prompt Template plugins and Native Plugins to build a completely automated AI agent for your organisation using Azure OpenAI (built on principles of enterprise-level security).
The copilot stack was first introduced by Satya Nadella in the Microsoft Build conference 2024, allowiing developers to build their own version of completely automated GenAI agents. The copilot stack is built on the principle of extensibility, extensibility of GenAI with other Azure Cloud-based services/offerings. The main heart of the copilot stack that integrates your GenAI models with other underlying core Azure services is the AI orchestration layer or the Semantic Kernel
. This web application is built majorly using the Semantic Kernel SDK for C#, although a python SDK is also available.
Microsoft and other Fortune 500 companies are already leveraging Semantic Kernel because it’s flexible, modular, and observable. Backed with security enhancing capabilities like telemetry support, and hooks and filters so you’ll feel confident you’re delivering responsible AI solutions at scale.
Semantic Kernel combines prompts with existing APIs to perform actions. By describing your existing code to AI models, they’ll be called to address requests. When a request is made the model calls a function, and Semantic Kernel is the middleware translating the model's request to a function call and passes the results back to the model.
The overall architecture makes use of the following services:
React.js
for frontenddotnet core Web API
for backend (written in C#).Semantic Kernel SDK for C#
for acting as the AI orchestration layer.Azure OpenAI
for LLM models.Azure Storage Account
for blob storage (making up for the datastore of Azure AI Search) and for queue service (Azure Storage Queue).Bing Search
service for making the Bing web Searcher PluginMicrosoft Graph APIs
for making the Graph Plugin.Azure AI Search
for RAG (Retrieval Augmented Generation). Extracting business and organizational data proprietary to a specific organization.Azure Cosmos DB for NoSQL
for making up as the persisted, global database for auditing purposes, chat history and making the app real-time.Azure Function
which is built on a queue based trigger and writes chat history data from Azure Storage Queue to the Cosmos DB database.
-
open the
COPILOTFULLSTACKAPP
folder in command prompt and enter the following commands:cd frontend
cd frontend
-
now install the npm modules with this command:
npm install
-
now run these commands:
cd src
npm run dev
The Front-end uses vite to run on a local server http://localhost:5173
-
make sure you have Azure CLI installed on your device through the following link (https://learn.microsoft.com/en-us/cli/azure/install-azure-cli).
-
open the
COPILOTFULLSTACKAPP
folder in powershell and enter the following commands:cd infrastructure setup
-
now you need to login to your azure account using the CLI:
az login
-
now run the powershell script to deploy the infra on Azure.
./deploy.ps1
-
navigate to
backend/AISearch
-
go to the
upload-docs.cmd
file and fill in the Subscription_id, azure_storage_account and azure_storage_key variables with appropriate values and run the following command in powershell to upload documents contained in theAISearch/data
folder to your storage account's container../upload-docs.cmd
-
now naviagate to
AISearch/data_source.json
and fill in the appropriate value ofconnectionString
with your storage account's connection string. -
navigate to
AISearch/skillset.json
and fill in the appropriate value ofkey
with the key of your multi-service AI account. -
navigate to
AISearch/create-search.cmd
and fill in the appropriate values ofurl
andadmin_key
and run the following command in powershell to create a complete AI Search solution for RAG purpose../create-search.cmd
-
Navigate to your Azure account and create an app registration with the following configurations:
a) The redirect URI needs to be kept blank and the name could be anything for the app registration.
b) The API permissions need to be assigned in the following manner.
-
Navigate to the "backend/appsetting.json" file and fill in the required values appropriately.
-
Open The
COPILOTFULLSTACKAPP
folder in command prompt and enter the following commands:cd backend
dotnet build
dotnet run
The Backend will be up and running locally on http://localhost:5124
-
Download The
Azure Functions Core Tools
from this link (https://learn.microsoft.com/en-us/azure/azure-functions/functions-run-local?tabs=windows%2Cisolated-process%2Cnode-v4%2Cpython-v2%2Chttp-trigger%2Ccontainer-apps&pivots=programming-language-csharp) to locally test and run your Azure Function. -
navigate to
azureFunctions/StorageQueueFunction/local.settings.json
and fill in the value ofAzureWebJobsStorage
with the value of connection string of your storage account -
navigate to
azureFunctions/StorageQueueFunction/Data/Secrets.cs
and fill in the value ofstorageConnectionString
andcosmosDBConnectionString
with appropriate values. -
Open The
COPILOTFULLSTACKAPP
folder in command prompt and enter the following commands:cd azureFunctions
cd StorageQueueFunction
func start
`