forked from AzureCosmosDB/cosmosdb-nosql-copilot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure.yaml
63 lines (62 loc) · 3.47 KB
/
azure.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# yaml-language-server: $schema=https://raw.githubusercontent.com/Azure/azure-dev/main/schemas/v1.0/azure.yaml.json
name: cosmos-copilot
metadata:
template: cosmos-copilot
services:
web:
project: ./src
language: csharp
host: appservice
hooks:
preprovision:
windows:
shell: pwsh
continueOnError: false
interactive: true
run: ./infra/azd-hooks/preprovision.ps1
posix:
shell: sh
continueOnError: false
interactive: true
run: chmod +x ./infra/azd-hooks/preprovision.sh
postprovision:
windows:
run: |
$userSecrets = @{
'OpenAi:Endpoint' = $env:AZURE_OPENAI_ACCOUNT_ENDPOINT
'OpenAi:CompletionDeploymentName' = $env:AZURE_OPENAI_COMPLETION_DEPLOYMENT_NAME
'OpenAi:EmbeddingDeploymentName' = $env:AZURE_OPENAI_EMBEDDING_DEPLOYMENT_NAME
'CosmosDb:Endpoint' = $env:AZURE_COSMOS_DB_ENDPOINT
'CosmosDb:Database' = $env:AZURE_COSMOS_DB_DATABASE_NAME
'CosmosDb:ChatContainer' = $env:AZURE_COSMOS_DB_CHAT_CONTAINER_NAME
'CosmosDb:CacheContainer' = $env:AZURE_COSMOS_DB_CACHE_CONTAINER_NAME
'CosmosDb:ProductContainer' = $env:AZURE_COSMOS_DB_PRODUCT_CONTAINER_NAME
'CosmosDb:ProductDataSourceURI' = $env:AZURE_COSMOS_DB_PRODUCT_DATA_SOURCE
'Chat:MaxConversationTokens' = $env:AZURE_CHAT_MAX_CONVERSATION_TOKENS
'Chat:CacheSimilarityScore' = $env:AZURE_CHAT_CACHE_SIMILARITY_SCORE
'Chat:ProductMaxResults' = $env:AZURE_CHAT_PRODUCT_MAX_RESULTS
}
$userSecrets | ConvertTo-Json | dotnet user-secrets set --project ./src/cosmos-copilot.csproj
shell: pwsh
continueOnError: false
interactive: true
posix:
run: |
userSecrets=$(jq --null-input --compact-output \
--arg openAiEndpoint $AZURE_OPENAI_ACCOUNT_ENDPOINT \
--arg openAiCompletionDeploymentName $AZURE_OPENAI_COMPLETION_DEPLOYMENT_NAME \
--arg openAiEmbeddingDeploymentName $AZURE_OPENAI_EMBEDDING_DEPLOYMENT_NAME \
--arg cosmosDbEndpoint $AZURE_COSMOS_DB_ENDPOINT \
--arg cosmosDbDatabase $AZURE_COSMOS_DB_DATABASE_NAME \
--arg cosmosDbChatContainer $AZURE_COSMOS_DB_CHAT_CONTAINER_NAME \
--arg cosmosDbCacheContainer $AZURE_COSMOS_DB_CACHE_CONTAINER_NAME \
--arg cosmosDbProductContainer $AZURE_COSMOS_DB_PRODUCT_CONTAINER_NAME \
--arg cosmosDbProductDataSourceURI $AZURE_COSMOS_DB_PRODUCT_DATA_SOURCE \
--arg maxConversationTokens $AZURE_CHAT_MAX_CONVERSATION_TOKENS \
--arg cacheSimilarityScore $AZURE_CHAT_CACHE_SIMILARITY_SCORE \
--arg productMaxResults $AZURE_CHAT_PRODUCT_MAX_RESULTS \
'{"OpenAi:Endpoint":$openAiEndpoint,"OpenAi:CompletionDeploymentName":$openAiCompletionDeploymentName,"OpenAi:EmbeddingDeploymentName":$openAiEmbeddingDeploymentName,"CosmosDb:Endpoint":$cosmosDbEndpoint,"CosmosDb:Database":$cosmosDbDatabase,"CosmosDb:ChatContainer":$cosmosDbChatContainer,"CosmosDb:CacheContainer":$cosmosDbCacheContainer,"CosmosDb:ProductContainer":$cosmosDbProductContainer,"CosmosDb:ProductDataSource":$cosmosDbProductDataSourceURI,"Chat:MaxConversationTokens":$maxConversationTokens,"Chat:CacheSimilarityScore":$cacheSimilarityScore,"Chat:ProductMaxResults":$productMaxResults}')
echo $userSecrets | dotnet user-secrets set --project ./src/cosmos-copilot.csproj
shell: sh
continueOnError: false
interactive: true