Skip to content

Commit 10cfc04

Browse files
authored
Make deploying the web searcher plugin optional (#517)
### Motivation and Context <!-- Thank you for your contribution to the chat-copilot repo! Please help reviewers and future users, providing the following information: 1. Why is this change required? 2. What problem does it solve? 3. What scenario does it contribute to? 4. If it fixes an open issue, please link to the issue here. --> The Web Searcher plugin requires a Bing resource, which may require elevated permission. This will fail the whole deployment, blocking developers from deploying the latest CC. Issues: #498 ### Description This PR makes deploying the Web Searcher plugin optional. And by default, it's NOT deployed. <!-- Describe your changes, the overall approach, the underlying design. These notes will help understanding how your code works. Thanks! --> ### Contribution Checklist <!-- Before submitting this PR, please make sure: --> - [ ] 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 - [ ] I didn't break anyone 😄
1 parent a8cbe87 commit 10cfc04

File tree

6 files changed

+280
-474
lines changed

6 files changed

+280
-474
lines changed

.github/workflows/copilot-deploy-infra.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,4 @@ jobs:
5959
inlineScript: |
6060
AI_SERVICE_KEY=$(az cognitiveservices account keys list --name ${{vars.AZUREOPENAI__NAME}} --resource-group ${{vars.AZUREOPENAI_DEPLOYMENT_GROUP_NAME}} | jq -r '.key1')
6161
echo "::add-mask::$AI_SERVICE_KEY"
62-
scripts/deploy/deploy-azure.sh --subscription ${{secrets.AZURE_SUBSCRIPTION_ID}} --resource-group ${{vars.CC_DEPLOYMENT_GROUP_NAME}} --deployment-name ${{steps.deployment-id.outputs.deployment_name}} --region ${{vars.CC_DEPLOYMENT_REGION}} --client-id ${{vars.BACKEND_CLIENT_ID}} --frontend-client-id ${{vars.APPLICATION_CLIENT_ID}} --tenant-id ${{secrets.AZURE_TENANT_ID}} --instance ${{vars.AZURE_INSTANCE}} --ai-service AzureOpenAI --ai-endpoint ${{secrets.AZURE_OPENAI_ENDPOINT}} --ai-service-key $AI_SERVICE_KEY --app-service-sku ${{vars.WEBAPP_API_SKU}} --no-deploy-package --debug-deployment
62+
scripts/deploy/deploy-azure.sh --subscription ${{secrets.AZURE_SUBSCRIPTION_ID}} --resource-group ${{vars.CC_DEPLOYMENT_GROUP_NAME}} --deployment-name ${{steps.deployment-id.outputs.deployment_name}} --region ${{vars.CC_DEPLOYMENT_REGION}} --client-id ${{vars.BACKEND_CLIENT_ID}} --frontend-client-id ${{vars.APPLICATION_CLIENT_ID}} --tenant-id ${{secrets.AZURE_TENANT_ID}} --instance ${{vars.AZURE_INSTANCE}} --ai-service AzureOpenAI --ai-endpoint ${{secrets.AZURE_OPENAI_ENDPOINT}} --ai-service-key $AI_SERVICE_KEY --app-service-sku ${{vars.WEBAPP_API_SKU}} --no-deploy-package --debug-deployment --deploy-web-searcher-plugin

scripts/deploy/README.md

+7-4
Original file line numberDiff line numberDiff line change
@@ -152,10 +152,13 @@ chmod +x ./deploy-webapi.sh
152152

153153
# Deploy Hosted Plugins
154154

155-
> **_NOTE:_** This step can be skipped if the previous Azure Resources creation step succeeded without errors. The `deployWebSearcherPackage = true` setting in main.bicep ensures that the WebSearcher is deployed.
155+
> **_NOTE:_** This step can be skipped if the required resources for the web searcher plugin are not deployed. The required resources include a Bing resource and an Azure Function. The required resources are NOT deployed by default. To deploy the required resources, use the `-DeployWebSearcherPlugin` or `--deploy-web-searcher-plugin` flag when running the **deploy-azure.ps1/deploy-azure.sh** script.
156+
157+
> **_NOTE:_** This step can be skipped if the previous Azure Resources creation step, including the resources required by the Web Search plugin, succeeded without errors. The `deployPackages = true` setting in main.bicep ensures that the WebSearcher is deployed.
158+
156159
> **_NOTE:_** More hosted plugins will be available.
157160
158-
To deploy the plugins, build the packages first and deploy then to the Azure resources created above.
161+
To deploy the plugins, build the packages first and deploy them to the Azure resources created above.
159162

160163
## PowerShell
161164

@@ -177,9 +180,9 @@ chmod +x ./deploy-plugins.sh
177180

178181
# (Optional) Deploy Memory Pipeline
179182

180-
> **_NOTE:_** This step can be skipped if the WebApi is not configured to run asynchronously for document processing. By default, the WebApi is configured to run asynchronously for document processing in deployment.
183+
> **_NOTE:_** This step can be skipped if the WebApi is NOT configured to run asynchronously for document processing. By default, the WebApi is configured to run asynchronously for document processing in deployment.
181184
182-
> **_NOTE:_** This step can be skipped if the previous Azure Resources creation step succeeded without errors. The deployMemoryPipelinePackage = true setting in main.bicep ensures that the latest Chat Copilot memory pipeline is deployed.
185+
> **_NOTE:_** This step can be skipped if the previous Azure Resources creation step succeeded without errors. The deployPackages = true setting in main.bicep ensures that the latest Chat Copilot memory pipeline is deployed.
183186
184187
To deploy the memorypipeline, build the deployment package first and deploy it to the Azure resources created above.
185188

scripts/deploy/deploy-azure.ps1

+6-1
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,10 @@ param(
7171
# Don't deploy Speech Services to enable speech as chat input
7272
$NoSpeechServices,
7373

74+
[switch]
75+
# Deploy the web searcher plugin
76+
$DeployWebSearcherPlugin,
77+
7478
[switch]
7579
# Switches on verbose template deployment output
7680
$DebugDeployment,
@@ -118,7 +122,8 @@ $jsonConfig = "
118122
`\`"deployNewAzureOpenAI`\`": { `\`"value`\`": $(If ($DeployAzureOpenAI) {"true"} Else {"false"}) },
119123
`\`"memoryStore`\`": { `\`"value`\`": `\`"$MemoryStore`\`" },
120124
`\`"deployCosmosDB`\`": { `\`"value`\`": $(If (!($NoCosmosDb)) {"true"} Else {"false"}) },
121-
`\`"deploySpeechServices`\`": { `\`"value`\`": $(If (!($NoSpeechServices)) {"true"} Else {"false"}) }
125+
`\`"deploySpeechServices`\`": { `\`"value`\`": $(If (!($NoSpeechServices)) {"true"} Else {"false"}) },
126+
`\`"deployWebSearcherPlugin`\`": { `\`"value`\`": $(If ($DeployWebSearcherPlugin) {"true"} Else {"false"}) }
122127
}
123128
"
124129

scripts/deploy/deploy-azure.sh

+8-1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ usage() {
2525
echo " \"AzureCognitiveSearch\" (default) and \"Qdrant\""
2626
echo " -nc, --no-cosmos-db Don't deploy Cosmos DB for chat storage - Use volatile memory instead"
2727
echo " -ns, --no-speech-services Don't deploy Speech Services to enable speech as chat input"
28+
echo " -ws, --deploy-web-searcher-plugin Deploy the web searcher plugin"
2829
echo " -dd, --debug-deployment Switches on verbose template deployment output"
2930
echo " -ndp, --no-deploy-package Skips deploying binary packages to cloud when set."
3031
}
@@ -105,6 +106,10 @@ while [[ $# -gt 0 ]]; do
105106
NO_SPEECH_SERVICES=true
106107
shift
107108
;;
109+
-ws | --deploy-web-searcher-plugin)
110+
DEPLOY_WEB_SEARCHER_PLUGIN=true
111+
shift
112+
;;
108113
-dd | --debug-deployment)
109114
DEBUG_DEPLOYMENT=true
110115
shift
@@ -182,6 +187,7 @@ az account set -s "$SUBSCRIPTION"
182187
: "${MEMORY_STORE:="AzureCognitiveSearch"}"
183188
: "${NO_COSMOS_DB:=false}"
184189
: "${NO_SPEECH_SERVICES:=false}"
190+
: "${DEPLOY_WEB_SEARCHER_PLUGIN:=false}"
185191

186192
# Create JSON config
187193
JSON_CONFIG=$(
@@ -199,7 +205,8 @@ JSON_CONFIG=$(
199205
"deployNewAzureOpenAI": { "value": $([ "$NO_NEW_AZURE_OPENAI" = true ] && echo "false" || echo "true") },
200206
"memoryStore": { "value": "$MEMORY_STORE" },
201207
"deployCosmosDB": { "value": $([ "$NO_COSMOS_DB" = true ] && echo "false" || echo "true") },
202-
"deploySpeechServices": { "value": $([ "$NO_SPEECH_SERVICES" = true ] && echo "false" || echo "true") }
208+
"deploySpeechServices": { "value": $([ "$NO_SPEECH_SERVICES" = true ] && echo "false" || echo "true") },
209+
"deployWebSearcherPlugin": { "value": $([ "$DEPLOY_WEB_SEARCHER_PLUGIN" = true ] && echo "true" || echo "false") }
203210
}
204211
EOF
205212
)

0 commit comments

Comments
 (0)