Skip to content

Commit

Permalink
update notebook and use url.parse
Browse files Browse the repository at this point in the history
  • Loading branch information
John Aziz authored and John Aziz committed Jul 19, 2024
1 parent 992a825 commit 437a2e9
Show file tree
Hide file tree
Showing 5 changed files with 206 additions and 196 deletions.
2 changes: 2 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ AZURE_OPENAI_ENDPOINT="https://<YOUR-OPENAI-DEPLOYMENT-NAME>.openai.azure.com/"
AZURE_OPENAI_API_KEY="<YOUR-DEPLOYMENT-KEY>"
# Environment variable obtained from Azure Cosmos DB for MongoDB vCore
AZURE_COSMOS_CONNECTION_STRING="<YOUR-COSMOS-DB-CONNECTION-STRING>"
AZURE_COSMOS_USERNAME="<YOUR-COSMOS-DB-USERNAME>"
AZURE_COSMOS_PASSWORD="<YOUR-COSMOS-DB-PASSWORD>"
# Environment variables you set to be used by the code
AZURE_COSMOS_DATABASE_NAME="<COSMOS-DB-NEW-UNIQUE-DATABASE-NAME>"
AZURE_COSMOS_COLLECTION_NAME="<COSMOS-DB-NEW-UNIQUE-COLLECTION-NAME>"
Expand Down
10 changes: 6 additions & 4 deletions infra/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -133,12 +133,12 @@ module mongoCluster 'core/database/cosmos/mongo/cosmos-mongo-cluster.bicep' = {

module keyVaultSecrets './core/security/keyvault-secret.bicep' = {
dependsOn: [ mongoCluster ]
name: 'keyvault-secret-mongo-connstr'
name: 'keyvault-secret-mongo-password'
scope: resourceGroup
params: {
name: 'mongoConnectionStr'
name: 'mongoAdminPassword'
keyVaultName: keyVault.outputs.name
secretValue: replace(replace(mongoCluster.outputs.connectionStringKey, '<user>', mongoAdminUser), '<password>', mongoAdminPassword)
secretValue: mongoAdminPassword
}
}

Expand All @@ -165,7 +165,9 @@ module web 'core/host/appservice.bicep' = {
AZURE_OPENAI_EMBEDDINGS_MODEL_NAME: embeddingModelName
AZURE_OPENAI_EMBEDDINGS_DEPLOYMENT_NAME: embeddingDeploymentName
AZURE_OPENAI_API_KEY: '@Microsoft.KeyVault(VaultName=${keyVault.outputs.name};SecretName=cognitiveServiceKey)'
AZURE_COSMOS_CONNECTION_STRING: '@Microsoft.KeyVault(VaultName=${keyVault.outputs.name};SecretName=mongoConnectionStr)'
AZURE_COSMOS_PASSWORD: '@Microsoft.KeyVault(VaultName=${keyVault.outputs.name};SecretName=mongoAdminPassword)'
AZURE_COSMOS_CONNECTION_STRING: mongoCluster.outputs.connectionStringKey
AZURE_COSMOS_USERNAME: mongoAdminUser
AZURE_COSMOS_DATABASE_NAME: 'lc_database'
AZURE_COSMOS_COLLECTION_NAME: 'lc_collection'
}
Expand Down
Loading

0 comments on commit 437a2e9

Please sign in to comment.