From 7f2e48e3dccc67ac1409445f5117110225dc83b2 Mon Sep 17 00:00:00 2001 From: Harsh-Microsoft Date: Fri, 25 Apr 2025 16:31:12 +0530 Subject: [PATCH 1/8] fix: update setup_env.sh to use sudo for script permissions and removed azure function tools; improve user email retrieval in create_sql_user_and_role.sh; clean up requirements --- .devcontainer/setup_env.sh | 8 +------- .github/workflows/CAdeploy.yml | 2 +- .gitignore | 3 +++ README.md | 2 +- .../add_user_scripts/create_sql_user_and_role.sh | 6 +++++- infra/scripts/index_scripts/create_sql_tables.py | 1 - infra/scripts/index_scripts/requirements.txt | 1 - infra/scripts/run_create_index_scripts.sh | 12 +++++++++++- 8 files changed, 22 insertions(+), 13 deletions(-) diff --git a/.devcontainer/setup_env.sh b/.devcontainer/setup_env.sh index d73f28c3d..b2d7806a9 100755 --- a/.devcontainer/setup_env.sh +++ b/.devcontainer/setup_env.sh @@ -4,7 +4,7 @@ git fetch git pull # provide execute permission to quotacheck script -chmod +x ./infra/scripts/checkquota.sh +sudo chmod +x ./infra/scripts/checkquota.sh # Add the path to ~/.bashrc for persistence if ! grep -q '/opt/mssql-tools18/bin' ~/.bashrc; then @@ -20,9 +20,3 @@ if ! command -v sqlcmd &> /dev/null; then exit 1 fi -# Install Azure function core tool -wget -q https://packages.microsoft.com/config/ubuntu/22.04/packages-microsoft-prod.deb -sudo dpkg -i packages-microsoft-prod.deb - -sudo apt-get update -sudo apt-get install azure-functions-core-tools-4 diff --git a/.github/workflows/CAdeploy.yml b/.github/workflows/CAdeploy.yml index c29837d9c..03ab12f99 100644 --- a/.github/workflows/CAdeploy.yml +++ b/.github/workflows/CAdeploy.yml @@ -115,7 +115,7 @@ jobs: az deployment group create \ --resource-group ${{ env.RESOURCE_GROUP_NAME }} \ --template-file infra/main.bicep \ - --parameters solutionPrefix=${{ env.SOLUTION_PREFIX }} cosmosLocation=${{ env.AZURE_LOCATION }} + --parameters AZURE_ENV_OPENAI_LOCATION=${{ env.AZURE_LOCATION }} - name: List KeyVaults and Store in Array id: list_keyvaults diff --git a/.gitignore b/.gitignore index 0b41d241c..f223f792e 100644 --- a/.gitignore +++ b/.gitignore @@ -401,3 +401,6 @@ FodyWeavers.xsd scriptenv .azure + +clientdata +clienttranscripts \ No newline at end of file diff --git a/README.md b/README.md index 71571abc0..4f182dcf8 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,7 @@ Follow the quick deploy steps on the deployment guide to deploy this solution to [Click here to launch the deployment guide](./docs/DeploymentGuide.md) -| [![Open in Codespaces](https://github.com/codespaces/badge.svg)](https://github.com/codespaces/new?repo=microsoft/Build-your-own-copilot-Solution-Accelerator&ref=dev) | [![Open in Dev Containers](https://img.shields.io/static/v1?style=for-the-badge&label=Dev%20Containers&message=Open&color=blue&logo=visualstudiocode)](https://vscode.dev/redirect?url=vscode://ms-vscode-remote.remote-containers/cloneInVolume?url=https://github.com/microsoft/Build-your-own-copilot-Solution-Accelerator&ref=dev) | +| [![Open in Codespaces](https://github.com/codespaces/badge.svg)](https://github.com/codespaces/new?repo=microsoft/Build-your-own-copilot-Solution-Accelerator) | [![Open in Dev Containers](https://img.shields.io/static/v1?style=for-the-badge&label=Dev%20Containers&message=Open&color=blue&logo=visualstudiocode)](https://vscode.dev/redirect?url=vscode://ms-vscode-remote.remote-containers/cloneInVolume?url=https://github.com/microsoft/Build-your-own-copilot-Solution-Accelerator) | |---|---| > ⚠️ **Important: Check Azure OpenAI Quota Availability**
To ensure sufficient quota is available in your subscription, please follow [quota check instructions guide](./docs/quota_check.md) before you deploy the solution. diff --git a/infra/scripts/add_user_scripts/create_sql_user_and_role.sh b/infra/scripts/add_user_scripts/create_sql_user_and_role.sh index 6eeb3b3ce..65526819c 100644 --- a/infra/scripts/add_user_scripts/create_sql_user_and_role.sh +++ b/infra/scripts/add_user_scripts/create_sql_user_and_role.sh @@ -92,7 +92,11 @@ OS=$(uname | tr '[:upper:]' '[:lower:]') if [[ "$OS" == "mingw"* || "$OS" == "cygwin"* || "$OS" == "msys"* ]]; then echo "Running on Windows OS, will use interactive login" echo "Getting signed in user email" - UserEmail=$(az ad signed-in-user show --query userPrincipalName -o tsv) + UserEmail=$(az ad signed-in-user show --query mail -o tsv) + # If the email is null or empty, use userPrincipalName + if [[ -z "$UserEmail" ]]; then + UserEmail=$(az ad signed-in-user show --query userPrincipalName -o tsv) + fi # Execute the SQL query echo "Executing SQL query..." sqlcmd -S "$SqlServerName" -d "$SqlDatabaseName" -G -U "$UserEmail" -Q "$SQL_QUERY_FINAL" || { diff --git a/infra/scripts/index_scripts/create_sql_tables.py b/infra/scripts/index_scripts/create_sql_tables.py index adaa95a48..322023f71 100644 --- a/infra/scripts/index_scripts/create_sql_tables.py +++ b/infra/scripts/index_scripts/create_sql_tables.py @@ -2,7 +2,6 @@ managed_identity_client_id = 'mici_to-be-replaced' import pandas as pd -import pymssql import os from datetime import datetime diff --git a/infra/scripts/index_scripts/requirements.txt b/infra/scripts/index_scripts/requirements.txt index 57cd45ab9..5dc5b5fab 100644 --- a/infra/scripts/index_scripts/requirements.txt +++ b/infra/scripts/index_scripts/requirements.txt @@ -10,7 +10,6 @@ azure-ai-textanalytics azure-search-documents==11.6.0b9 azure-keyvault-secrets pandas -pymssql datetime pyodbc==5.2.0 \ No newline at end of file diff --git a/infra/scripts/run_create_index_scripts.sh b/infra/scripts/run_create_index_scripts.sh index c701d4700..0f7da6294 100644 --- a/infra/scripts/run_create_index_scripts.sh +++ b/infra/scripts/run_create_index_scripts.sh @@ -118,13 +118,23 @@ if [ -n "$managedIdentityClientId" ]; then sed -i "s/mici_to-be-replaced/${managedIdentityClientId}/g" ${pythonScriptPath}"create_sql_tables.py" fi +# Determine the correct Python command +if command -v python3 &> /dev/null; then + PYTHON_CMD="python3" +elif command -v python &> /dev/null; then + PYTHON_CMD="python" +else + echo "Python is not installed on this system. Or it is not added in the PATH." + exit 1 +fi + # create virtual environment # Check if the virtual environment already exists if [ -d $pythonScriptPath"scriptenv" ]; then echo "Virtual environment already exists. Skipping creation." else echo "Creating virtual environment" - python3 -m venv $pythonScriptPath"scriptenv" + $PYTHON_CMD -m venv $pythonScriptPath"scriptenv" fi # Activate the virtual environment From 96e62dfc40945ed6951f573d80aaf0e441579c4e Mon Sep 17 00:00:00 2001 From: Harsh-Microsoft Date: Fri, 25 Apr 2025 17:28:06 +0530 Subject: [PATCH 2/8] fix: update setup_env.sh to ensure execute permissions for quota_check_params.sh; adjust Deployment Guide token capacity recommendation and Python version range --- .devcontainer/setup_env.sh | 1 + docs/DeploymentGuide.md | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.devcontainer/setup_env.sh b/.devcontainer/setup_env.sh index b2d7806a9..c3a31369d 100755 --- a/.devcontainer/setup_env.sh +++ b/.devcontainer/setup_env.sh @@ -5,6 +5,7 @@ git pull # provide execute permission to quotacheck script sudo chmod +x ./infra/scripts/checkquota.sh +sudo chmod +x ./infra/scripts/quota_check_params.sh # Add the path to ~/.bashrc for persistence if ! grep -q '/opt/mssql-tools18/bin' ~/.bashrc; then diff --git a/docs/DeploymentGuide.md b/docs/DeploymentGuide.md index fc6a69a88..a580e3ed9 100644 --- a/docs/DeploymentGuide.md +++ b/docs/DeploymentGuide.md @@ -24,7 +24,7 @@ Here are some example regions where the services are available: East US, East US ### [Optional] Quota Recommendations By default, the **Gpt-4o-mini model capacity** in deployment is set to **30k tokens**, so we recommend -> **For Global Standard | GPT-4o-mini - the capacity to at least 100k tokens post-deployment for optimal performance.** +> **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](AzureGPTQuotaSettings.md) @@ -80,7 +80,7 @@ If you're not using one of the above options for opening the project, then you'l 1. Make sure the following tools are installed: - [PowerShell](https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell?view=powershell-7.5) (v7.0+) - available for Windows, macOS, and Linux. - [Azure Developer CLI (azd)](https://aka.ms/install-azd) - - [Python 3.9+](https://www.python.org/downloads/) + - [Python 3.9 to 3.11](https://www.python.org/downloads/) - [Docker Desktop](https://www.docker.com/products/docker-desktop/) - [Git](https://git-scm.com/downloads) - [Microsoft ODBC Driver 18 for SQL Server](https://learn.microsoft.com/en-us/sql/connect/odbc/download-odbc-driver-for-sql-server?view=sql-server-ver16) From f26be922d7d6efedada84e543f1c74796f836296 Mon Sep 17 00:00:00 2001 From: Harsh-Microsoft Date: Fri, 25 Apr 2025 18:15:28 +0530 Subject: [PATCH 3/8] update FabricDeployment.md --- docs/FabricDeployment.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/docs/FabricDeployment.md b/docs/FabricDeployment.md index 6e527bcd2..c42dd51f6 100644 --- a/docs/FabricDeployment.md +++ b/docs/FabricDeployment.md @@ -47,7 +47,9 @@ 2. Select Fabric Workspace 3. Click `Select` 4. After publish is complete, navigate to Fabric Workspace -5. Click `...` next to the Semantic model for Power BI report +5. You will find the report in the Fabric Workspace under the name **WealthAdvisor-Client360Report**. +6. Compare the values in the report with the responses provided by the Client Advisor chatbot to verify their accuracy and credibility. + -## Step 5: Update the Power BI URL in Azure App Service configuration + From 3825e7c711630dd4acc62f804371793815308d4b Mon Sep 17 00:00:00 2001 From: Harsh-Microsoft Date: Fri, 25 Apr 2025 18:57:13 +0530 Subject: [PATCH 4/8] update FabricDeployment.md --- docs/FabricDeployment.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/FabricDeployment.md b/docs/FabricDeployment.md index c42dd51f6..6bc6be7fc 100644 --- a/docs/FabricDeployment.md +++ b/docs/FabricDeployment.md @@ -47,8 +47,8 @@ 2. Select Fabric Workspace 3. Click `Select` 4. After publish is complete, navigate to Fabric Workspace -5. You will find the report in the Fabric Workspace under the name **WealthAdvisor-Client360Report**. -6. Compare the values in the report with the responses provided by the Client Advisor chatbot to verify their accuracy and credibility. +5. You will find the report in the Fabric Workspace under the name **WealthAdvisor-Client360Report**. +6. Use the report's filtering options to analyze client data. Cross-check the values in the report with the responses provided by the Client Advisor chatbot to ensure their accuracy and reliability.