Skip to content

Commit 944b1ef

Browse files
authored
Fix fatal issues with Azure deployment templates (microsoft#513)
### Motivation and Context Current Azure ARM template is not functional ### Description - Remove embedding storage methods no longer support (Volatile and PostGres) - Merge the 3 app insights into 1 - Have a single switch for whether to deploy binary packages - Remove obsolete MemoryStore app settings - Add Qdrant settings to SemanticMemory:Services - Add memory pipeline service to Qdrant vnet ### Contribution Checklist - [ ] The code builds clean without any errors or warnings - [ ] The PR follows the [Contribution Guidelines](https://github.com/microsoft/chat-copilot/blob/main/CONTRIBUTING.md) and the [pre-submission formatting script](https://github.com/microsoft/chat-copilot/blob/main/CONTRIBUTING.md#development-scripts) raises no violations - [ ] All unit tests pass, and I have added new tests where possible
1 parent 5dd5785 commit 944b1ef

File tree

4 files changed

+80
-375
lines changed

4 files changed

+80
-375
lines changed

scripts/deploy/deploy-azure.ps1

+7-20
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ param(
4747
$ResourceGroup,
4848

4949
[string]
50-
# Region to which to make the deployment (ignored when deploying to an existing resource group)
50+
# Region to which to make the deployment
5151
$Region = "southcentralus",
5252

5353
[string]
@@ -58,15 +58,11 @@ param(
5858
# Azure AD cloud instance for authenticating users
5959
$AzureAdInstance = "https://login.microsoftonline.com",
6060

61-
[ValidateSet("Volatile", "AzureCognitiveSearch", "Qdrant", "Postgres")]
61+
[ValidateSet("AzureCognitiveSearch", "Qdrant")]
6262
[string]
6363
# What method to use to persist embeddings
6464
$MemoryStore = "AzureCognitiveSearch",
6565

66-
[SecureString]
67-
# Password for the Postgres database
68-
$SqlAdminPassword,
69-
7066
[switch]
7167
# Don't deploy Cosmos DB for chat storage - Use volatile memory instead
7268
$NoCosmosDb,
@@ -80,26 +76,25 @@ param(
8076
$DebugDeployment,
8177

8278
[switch]
83-
# Switches on whether to deploy release packages
79+
# Skip deployment of binary packages
8480
$NoDeployPackage
8581
)
8682

8783
# if AIService is AzureOpenAI
8884
if ($AIService -eq "AzureOpenAI") {
8985
# Both $AIEndpoint and $AIApiKey must be set
9086
if ((!$AIEndpoint -and $AIApiKey) -or ($AIEndpoint -and !$AIApiKey)) {
91-
Write-Error "When AIService is AzureOpenAI, when either AIEndpoint and AIApiKey are set then both must be set."
87+
Write-Error "When AIService is AzureOpenAI, both AIEndpoint and AIApiKey must be set."
9288
exit 1
9389
}
9490

9591
# If both $AIEndpoint and $AIApiKey are not set, set $DeployAzureOpenAI to true and inform the user. Otherwise set $DeployAzureOpenAI to false and inform the user.
9692
if (!$AIEndpoint -and !$AIApiKey) {
9793
$DeployAzureOpenAI = $true
98-
Write-Host "When AIService is AzureOpenAI and both AIEndpoint and AIApiKey are not set then a new Azure OpenAI resource will be created."
94+
Write-Host "When AIService is AzureOpenAI and both AIEndpoint and AIApiKey are not set, then a new Azure OpenAI resource will be created."
9995
}
10096
else {
10197
$DeployAzureOpenAI = $false
102-
Write-Host "When AIService is AzureOpenAI and both AIEndpoint and AIApiKey are set, use the existing Azure OpenAI resource."
10398
}
10499
}
105100

@@ -109,29 +104,21 @@ if ($AIService -eq "OpenAI" -and !$AIApiKey) {
109104
exit 1
110105
}
111106

112-
if ($MemoryStore -eq "Postgres" -and !$SqlAdminPassword) {
113-
Write-Host "When MemoryStore is Postgres, SqlAdminPassword must be set"
114-
exit 1
115-
}
116-
117107
$jsonConfig = "
118108
{
119109
`\`"webAppServiceSku`\`": { `\`"value`\`": `\`"$WebAppServiceSku`\`" },
120110
`\`"aiService`\`": { `\`"value`\`": `\`"$AIService`\`" },
121111
`\`"aiApiKey`\`": { `\`"value`\`": `\`"$AIApiKey`\`" },
122112
`\`"aiEndpoint`\`": { `\`"value`\`": `\`"$AIEndpoint`\`" },
123-
`\`"deployWebApiPackage`\`": { `\`"value`\`": $(If (!($NoDeployPackage)) {"true"} Else {"false"}) },
124-
`\`"deployMemoryPipelinePackage`\`": { `\`"value`\`": $(If (!($NoDeployPackage)) {"true"} Else {"false"}) },
125-
`\`"deployWebSearcherPackage`\`": { `\`"value`\`": $(If (!($NoDeployPackage)) {"true"} Else {"false"}) },
113+
`\`"deployPackages`\`": { `\`"value`\`": $(If ($NoDeployPackage) {"false"} Else {"true"}) },
126114
`\`"azureAdInstance`\`": { `\`"value`\`": `\`"$AzureAdInstance`\`" },
127115
`\`"azureAdTenantId`\`": { `\`"value`\`": `\`"$TenantId`\`" },
128116
`\`"webApiClientId`\`": { `\`"value`\`": `\`"$BackendClientId`\`"},
129117
`\`"frontendClientId`\`": { `\`"value`\`": `\`"$FrontendClientId`\`"},
130118
`\`"deployNewAzureOpenAI`\`": { `\`"value`\`": $(If ($DeployAzureOpenAI) {"true"} Else {"false"}) },
131119
`\`"memoryStore`\`": { `\`"value`\`": `\`"$MemoryStore`\`" },
132120
`\`"deployCosmosDB`\`": { `\`"value`\`": $(If (!($NoCosmosDb)) {"true"} Else {"false"}) },
133-
`\`"deploySpeechServices`\`": { `\`"value`\`": $(If (!($NoSpeechServices)) {"true"} Else {"false"}) },
134-
`\`"sqlAdminPassword`\`": { `\`"value`\`": `\`"$(If ($SqlAdminPassword) {ConvertFrom-SecureString $SqlAdminPassword -AsPlainText} Else {$null})`\`" }
121+
`\`"deploySpeechServices`\`": { `\`"value`\`": $(If (!($NoSpeechServices)) {"true"} Else {"false"}) }
135122
}
136123
"
137124

scripts/deploy/deploy-azure.sh

+3-19
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,11 @@ usage() {
2222
echo " -i, --instance AZURE_AD_INSTANCE Azure AD cloud instance for authenticating users"
2323
echo " (default: \"https://login.microsoftonline.com\")"
2424
echo " -ms, --memory-store Method to use to persist embeddings. Valid values are"
25-
echo " \"AzureCognitiveSearch\" (default), \"Qdrant\", \"Postgres\" and \"Volatile\""
26-
echo " -sap, --sql-admin-password Password for the PostgreSQL Server admin user"
25+
echo " \"AzureCognitiveSearch\" (default) and \"Qdrant\""
2726
echo " -nc, --no-cosmos-db Don't deploy Cosmos DB for chat storage - Use volatile memory instead"
2827
echo " -ns, --no-speech-services Don't deploy Speech Services to enable speech as chat input"
2928
echo " -dd, --debug-deployment Switches on verbose template deployment output"
30-
echo " -ndp, --no-deploy-package Skips deploying the Web API package when set."
29+
echo " -ndp, --no-deploy-package Skips deploying binary packages to cloud when set."
3130
}
3231

3332
# Parse arguments
@@ -98,11 +97,6 @@ while [[ $# -gt 0 ]]; do
9897
MEMORY_STORE=="$2"
9998
shift
10099
;;
101-
-sap | --sql-admin-password)
102-
SQL_ADMIN_PASSWORD="$2"
103-
shift
104-
shift
105-
;;
106100
-nc | --no-cosmos-db)
107101
NO_COSMOS_DB=true
108102
shift
@@ -166,13 +160,6 @@ if [[ "${AI_SERVICE_TYPE,,}" = "openai" ]] && [[ -z "$AI_SERVICE_KEY" ]]; then
166160
exit 1
167161
fi
168162

169-
# If MEMORY_STORE is Postges, then SQL_ADMIN_PASSWORD is mandatory
170-
if [[ "${MEMORY_STORE,,}" = "postgres" ]] && [[ -z "$SQL_ADMIN_PASSWORD" ]]; then
171-
echo "When --memory-store is 'Postgres', --sql-admin-password must be set."
172-
usage
173-
exit 1
174-
fi
175-
176163
# If resource group is not set, then set it to rg-DEPLOYMENT_NAME
177164
if [ -z "$RESOURCE_GROUP" ]; then
178165
RESOURCE_GROUP="rg-${DEPLOYMENT_NAME}"
@@ -203,17 +190,14 @@ JSON_CONFIG=$(
203190
"webAppServiceSku": { "value": "$WEB_APP_SVC_SKU" },
204191
"aiService": { "value": "$AI_SERVICE_TYPE" },
205192
"aiApiKey": { "value": "$AI_SERVICE_KEY" },
206-
"deployWebApiPackage": { "value": $([ "$NO_DEPLOY_PACKAGE" = true ] && echo "false" || echo "true") },
207-
"deployMemoryPipelinePackage": { "value": $([ "$NO_DEPLOY_PACKAGE" = true ] && echo "false" || echo "true") },
208-
"deployWebSearcherPackage": { "value": $([ "$NO_DEPLOY_PACKAGE" = true ] && echo "false" || echo "true") },
193+
"deployPackages": { "value": $([ "$NO_DEPLOY_PACKAGE" = true ] && echo "false" || echo "true") },
209194
"aiEndpoint": { "value": "$([ ! -z "$AI_ENDPOINT" ] && echo "$AI_ENDPOINT")" },
210195
"azureAdInstance": { "value": "$AZURE_AD_INSTANCE" },
211196
"azureAdTenantId": { "value": "$AZURE_AD_TENANT_ID" },
212197
"webApiClientId": { "value": "$BACKEND_CLIENT_ID" },
213198
"frontendClientId": { "value": "$FRONTEND_CLIENT_ID" },
214199
"deployNewAzureOpenAI": { "value": $([ "$NO_NEW_AZURE_OPENAI" = true ] && echo "false" || echo "true") },
215200
"memoryStore": { "value": "$MEMORY_STORE" },
216-
"sqlAdminPassword": { "value": "$SQL_ADMIN_PASSWORD" },
217201
"deployCosmosDB": { "value": $([ "$NO_COSMOS_DB" = true ] && echo "false" || echo "true") },
218202
"deploySpeechServices": { "value": $([ "$NO_SPEECH_SERVICES" = true ] && echo "false" || echo "true") }
219203
}

0 commit comments

Comments
 (0)