From a0ff49312776802b3f913fc9e94edea526b1968a Mon Sep 17 00:00:00 2001 From: Lyle Xu Date: Thu, 29 Feb 2024 17:24:57 +0800 Subject: [PATCH] fix key vault resource gorup error --- Environments/Todo-Nodejs-Mongo-AKS/app/db.bicep | 2 ++ Environments/Todo-Nodejs-Mongo-AKS/main.bicep | 2 ++ Environments/Todo-Nodejs-Mongo-AKS/manifest.yaml | 8 +++++++- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Environments/Todo-Nodejs-Mongo-AKS/app/db.bicep b/Environments/Todo-Nodejs-Mongo-AKS/app/db.bicep index 938949c6..8d828333 100644 --- a/Environments/Todo-Nodejs-Mongo-AKS/app/db.bicep +++ b/Environments/Todo-Nodejs-Mongo-AKS/app/db.bicep @@ -18,6 +18,7 @@ param collections array = [ ] param databaseName string = '' param keyVaultName string +param keyVaultResourceGroupName string // Because databaseName is optional in main.bicep, we make sure the database name is set here. var defaultDatabaseName = 'Todo' @@ -31,6 +32,7 @@ module cosmos '../core/database/cosmos/mongo/cosmos-mongo-db.bicep' = { location: location collections: collections keyVaultName: keyVaultName + keyVaultResourceGroupName: keyVaultResourceGroupName tags: tags } } diff --git a/Environments/Todo-Nodejs-Mongo-AKS/main.bicep b/Environments/Todo-Nodejs-Mongo-AKS/main.bicep index 0320a02a..c70b89ac 100644 --- a/Environments/Todo-Nodejs-Mongo-AKS/main.bicep +++ b/Environments/Todo-Nodejs-Mongo-AKS/main.bicep @@ -10,6 +10,7 @@ param location string = resourceGroup().location param cosmosAccountName string = '' param cosmosDatabaseName string = '' param keyvaultName string = '' +param keyVaultResourceGroupName string = resourceGroup().name var abbrs = loadJsonContent('./abbreviations.json') var resourceToken = toLower(uniqueString(subscription().id, environmentName, location)) @@ -24,6 +25,7 @@ module cosmos './app/db.bicep' = { location: location tags: tags keyVaultName: keyvaultName + keyVaultResourceGroupName: keyVaultResourceGroupName } } diff --git a/Environments/Todo-Nodejs-Mongo-AKS/manifest.yaml b/Environments/Todo-Nodejs-Mongo-AKS/manifest.yaml index 5a56bb76..18c37573 100644 --- a/Environments/Todo-Nodejs-Mongo-AKS/manifest.yaml +++ b/Environments/Todo-Nodejs-Mongo-AKS/manifest.yaml @@ -22,4 +22,10 @@ parameters: name: "keyvaultName (e.g. kv-abc123)" description: "keyvault name that store the secret for mongo connection string" type: string - required: true \ No newline at end of file + required: true + +- id: "keyvaultResourceGroupName" + name: "keyvaultResourceGroupName (e.g. rg-abc123)" + description: "keyvault group name contains the key vault above" + type: string + required: true \ No newline at end of file