To deploy this solution accelerator, ensure you have access to an Azure subscription with the necessary permissions to create resource groups, resources, and assign roles at the resource group level*. Follow the steps in Azure Account Set Up
Check the Azure Products by Region page and select a region where the following services are available:
- Azure OpenAI
- Azure AI Search
- Azure App Service
- Azure SQL Database
- Microsoft Fabric
- Azure Semantic Search
Here are some example regions where the services are available: East US, East US2, Australia East, UK South, France Central.
By default, the Gpt-4o-mini model capacity in deployment is set to 30k tokens, so we recommend
For Global Standard | GPT-4o-mini - increase the capacity to at least 150k tokens post-deployment for optimal performance.
To adjust quota settings, follow these steps
Pick from the options below to see step-by-step instructions for GitHub Codespaces, VS Code Dev Containers, and Local Environments.
Deploy in GitHub Codespaces
You can run this solution using GitHub Codespaces. The button will open a web-based VS Code instance in your browser:
-
Open the solution accelerator (this may take several minutes):
-
Accept the default values on the create Codespaces page.
-
Open a terminal window if it is not already open.
-
Continue with the deploying steps.
Deploy in VS Code
You can run this solution in 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.
Deploy in your local Environment
If you're not using one of the above options for opening the project, then you'll need to:
-
Make sure the following tools are installed:
- PowerShell (v7.0+) - available for Windows, macOS, and Linux.
- Azure Developer CLI (azd)
- Python 3.9 to 3.11
- Docker Desktop
- Git
- Microsoft ODBC Driver 18 for SQL Server
- sqlcmd(ODBC-Windows) / sqlcmd(Linux/Mac)
-
Clone the repository or download the project code via command-line:
azd init -t microsoft/build-your-own-copilot-solution-accelerator/
-
Open the project folder in your terminal or editor.
-
Continue with the deploying steps.
Consider the following settings during your deployment to modify specific settings:
Configurable Deployment Settings
When you start the deployment, most parameters will have default values, but you can update the below settings by following the steps here:
Setting | Description | Default value |
---|---|---|
Azure OpenAI Location | The region where OpenAI deploys | eastus2 |
Environment Name | A 3-20 character alphanumeric value used to generate a unique ID to prefix the resources. | byocatemplate |
Cosmos Location | A less busy region for CosmosDB, useful in case of availability constraints. | eastus2 |
Deployment Type | Select from a drop-down list. | Global Standard |
GPT Model | OpenAI GPT model | gpt-4o-mini |
GPT Model Deployment Capacity | Configure capacity for GPT models. | 30k |
Embedding Model | OpenAI embedding model | text-embedding-ada-002 |
Embedding Model Capacity | Set the capacity for embedding models. | 80k |
[Optional] Quota Recommendations
By default, the GPT model capacity in deployment is set to 30k tokens.
We recommend increasing the capacity to 100k tokens, if available, for optimal performance.
To adjust quota settings, follow these steps.
Once you've opened the project in Codespaces, Dev Containers, or locally, you can deploy it to Azure by following these steps:
-
Login to Azure:
azd auth login
azd auth login --tenant-id <tenant-id>
Note: To retrieve the Tenant ID required for local deployment, you can go to Tenant Properties in Azure Portal from the resource list. Alternatively, follow these steps:
- Open the Azure Portal.
- Navigate to Azure Active Directory from the left-hand menu.
- Under the Overview section, locate the Tenant ID field. Copy the value displayed.
-
Provision and deploy all the resources:
azd up
-
Provide an
azd
environment name (e.g., "byocaapp"). -
Select a subscription from your Azure account and choose a location that has quota for all the resources.
- This deployment will take 7-10 minutes to provision the resources in your account and set up the solution with sample data.
- If you encounter an error or timeout during deployment, changing the location may help, as there could be availability constraints for the resources.
-
Once the deployment is complete, please follow the Import Sample Data instructions under Post Deployment Steps to load the sample data correctly.
-
Open the Azure Portal, go to the deployed resource group, find the App Service and get the app URL from
Default domain
. -
Test the app locally with the sample question with any selected client: Show latest asset value by asset type?. For more sample questions you can test in the application, see Sample Questions.
-
You can now delete the resources by running
azd down
, if you are done trying out the application.
If you need to rebuild the source code and push the updated container to the deployed Azure Container Registry, follow these steps:
-
Set the environment variable
USE_LOCAL_BUILD
toTrue
:-
Linux/macOS:
export USE_LOCAL_BUILD=True
-
Windows (PowerShell):
$env:USE_LOCAL_BUILD = $true
-
-
Run the
az login
commandaz login
-
Run the
azd up
command again to rebuild and push the updated container:azd up
This will rebuild the source code, package it into a container, and push it to the Azure Container Registry associated with your deployment.
-
Import Sample Data -Run bash command printed in the terminal. The bash command will look like the following:
bash ./infra/scripts/process_sample_data.sh
if you don't have azd env then you need to pass parameters along with the command. Then the command will look like the following:
bash ./infra/scripts/process_sample_data.sh <resourceGroupName> <cosmosDbAccountName> <storageAccount> <storageContainerName> <keyvaultName> <sqlServerName> <sqlDatabaseName> <webAppUserManagedIdentityClientId> <webAppUserManagedIdentityDisplayName>
-
Add Authentication Provider
- Follow steps in App Authentication to configure authenitcation in app service. Note that Authentication changes can take up to 10 minutes.
-
Fabric Configuration,
- Follow steps in Fabric Deployment guide to set up the data processing pipelines and Power BI report in Fabric.
-
Teams App Configuration
- (Optional) Follow steps in Teams Tab App guide to add the Client Advisor app to Microsoft Teams.
-
Deleting Resources After a Failed Deployment
- Follow steps in Delete Resource Group if your deployment fails and/or you need to clean up the resources.