Skip to content

Commit

Permalink
CopilotChat: add missing container (microsoft#1533)
Browse files Browse the repository at this point in the history
### Motivation and Context
<!-- Thank you for your contribution to the semantic-kernel 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.
-->

This fixes an
[issue](microsoft#1402) with
uploading documents from the copilot chat sample app when Azure Cosmos
DB resources are used.

### Description
The `chatmemorysources` Cosmos DB container referenced in the web API
appsettings.json was missing from the bicep template and this caused the
"resource not found" error.


### Contribution Checklist
<!-- Before submitting this PR, please make sure: -->
- [x] The code builds clean without any errors or warnings
- [x] The PR follows SK Contribution Guidelines
(https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md)
- [x] The code follows the .NET coding conventions
(https://learn.microsoft.com/dotnet/csharp/fundamentals/coding-style/coding-conventions)
verified with `dotnet format`
- [x] All unit tests pass, and I have added new tests where possible
- [x] I didn't break anyone 😄

Co-authored-by: Craig Presti <146438+craigomatic@users.noreply.github.com>
Co-authored-by: Adrian Bonar <56417140+adrianwyatt@users.noreply.github.com>
  • Loading branch information
3 people authored and name committed Jul 5, 2023
1 parent 9f0ed87 commit 970334a
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions samples/apps/copilot-chat-app/deploy/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,10 @@ resource appServiceWebConfig 'Microsoft.Web/sites/config@2022-09-01' = {
name: 'ChatStore:Cosmos:ChatMessagesContainer'
value: 'chatmessages'
}
{
name: 'ChatStore:Cosmos:ChatMemorySourcesContainer'
value: 'chatmemorysources'
}
{
name: 'ChatStore:Cosmos:ConnectionString'
value: deployCosmosDB ? cosmosAccount.listConnectionStrings().connectionStrings[0].connectionString : ''
Expand Down Expand Up @@ -632,6 +636,37 @@ resource participantContainer 'Microsoft.DocumentDB/databaseAccounts/sqlDatabase
}
}

resource memorySourcesContainer 'Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers@2023-04-15' = if (deployCosmosDB) {
parent: cosmosDatabase
name: 'chatmemorysources'
properties: {
resource: {
id: 'chatmemorysources'
indexingPolicy: {
indexingMode: 'consistent'
automatic: true
includedPaths: [
{
path: '/*'
}
]
excludedPaths: [
{
path: '/"_etag"/?'
}
]
}
partitionKey: {
paths: [
'/id'
]
kind: 'Hash'
version: 2
}
}
}
}

resource speechAccount 'Microsoft.CognitiveServices/accounts@2022-12-01' = if (deploySpeechServices) {
name: 'cog-${uniqueName}'
location: location
Expand Down

0 comments on commit 970334a

Please sign in to comment.