Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
luxu-ms committed Feb 29, 2024
2 parents f4161ea + 1a9f95e commit 22cba59
Showing 1 changed file with 84 additions and 9 deletions.
93 changes: 84 additions & 9 deletions Environments/Todo-Mongo-AKS/azuredeploy.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"_generator": {
"name": "bicep",
"version": "0.25.53.49325",
"templateHash": "14091873261497882625"
"templateHash": "11686091938214168014"
}
},
"parameters": {
Expand Down Expand Up @@ -36,6 +36,10 @@
"keyvaultName": {
"type": "string",
"defaultValue": ""
},
"keyVaultResourceGroupName": {
"type": "string",
"defaultValue": "[resourceGroup().name]"
}
},
"variables": {
Expand Down Expand Up @@ -204,6 +208,9 @@
},
"keyVaultName": {
"value": "[parameters('keyvaultName')]"
},
"keyVaultResourceGroupName": {
"value": "[parameters('keyVaultResourceGroupName')]"
}
},
"template": {
Expand All @@ -213,7 +220,7 @@
"_generator": {
"name": "bicep",
"version": "0.25.53.49325",
"templateHash": "5730728686647632614"
"templateHash": "850519296196313996"
}
},
"parameters": {
Expand Down Expand Up @@ -251,6 +258,9 @@
},
"keyVaultName": {
"type": "string"
},
"keyVaultResourceGroupName": {
"type": "string"
}
},
"variables": {
Expand Down Expand Up @@ -283,6 +293,9 @@
"keyVaultName": {
"value": "[parameters('keyVaultName')]"
},
"keyVaultResourceGroupName": {
"value": "[parameters('keyVaultResourceGroupName')]"
},
"tags": {
"value": "[parameters('tags')]"
}
Expand All @@ -294,7 +307,7 @@
"_generator": {
"name": "bicep",
"version": "0.25.53.49325",
"templateHash": "14549161001187918251"
"templateHash": "13509848683723089892"
},
"description": "Creates an Azure Cosmos DB for MongoDB account with a database."
},
Expand Down Expand Up @@ -323,6 +336,9 @@
},
"keyVaultName": {
"type": "string"
},
"keyVaultResourceGroupName": {
"type": "string"
}
},
"resources": [
Expand Down Expand Up @@ -388,6 +404,9 @@
"keyVaultName": {
"value": "[parameters('keyVaultName')]"
},
"keyVaultResourceGroupName": {
"value": "[parameters('keyVaultResourceGroupName')]"
},
"tags": {
"value": "[parameters('tags')]"
},
Expand All @@ -402,7 +421,7 @@
"_generator": {
"name": "bicep",
"version": "0.25.53.49325",
"templateHash": "8317058180807592714"
"templateHash": "6834223066721695440"
},
"description": "Creates an Azure Cosmos DB for MongoDB account."
},
Expand All @@ -421,6 +440,9 @@
"keyVaultName": {
"type": "string"
},
"keyVaultResourceGroupName": {
"type": "string"
},
"connectionStringKey": {
"type": "string",
"defaultValue": "AZURE-COSMOS-CONNECTION-STRING"
Expand Down Expand Up @@ -449,6 +471,9 @@
"keyVaultName": {
"value": "[parameters('keyVaultName')]"
},
"keyVaultResourceGroupName": {
"value": "[parameters('keyVaultResourceGroupName')]"
},
"kind": {
"value": "MongoDB"
},
Expand All @@ -463,7 +488,7 @@
"_generator": {
"name": "bicep",
"version": "0.25.53.49325",
"templateHash": "13614361263700788271"
"templateHash": "263326484500044406"
},
"description": "Creates an Azure Cosmos DB account."
},
Expand All @@ -486,6 +511,9 @@
"keyVaultName": {
"type": "string"
},
"keyVaultResourceGroupName": {
"type": "string"
},
"kind": {
"type": "string",
"allowedValues": [
Expand Down Expand Up @@ -526,11 +554,58 @@
}
},
{
"type": "Microsoft.KeyVault/vaults/secrets",
"apiVersion": "2022-07-01",
"name": "[format('{0}/{1}', parameters('keyVaultName'), parameters('connectionStringKey'))]",
"type": "Microsoft.Resources/deployments",
"apiVersion": "2022-09-01",
"name": "cosmosConnectionStringModule",
"resourceGroup": "[parameters('keyVaultResourceGroupName')]",
"properties": {
"value": "[listConnectionStrings(resourceId('Microsoft.DocumentDB/databaseAccounts', parameters('name')), '2022-08-15').connectionStrings[0].connectionString]"
"expressionEvaluationOptions": {
"scope": "inner"
},
"mode": "Incremental",
"parameters": {
"keyVaultName": {
"value": "[parameters('keyVaultName')]"
},
"connectionStringKey": {
"value": "[parameters('connectionStringKey')]"
},
"connectionString": {
"value": "[listConnectionStrings(resourceId('Microsoft.DocumentDB/databaseAccounts', parameters('name')), '2022-08-15').connectionStrings[0].connectionString]"
}
},
"template": {
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.25.53.49325",
"templateHash": "16039028337730776547"
}
},
"parameters": {
"keyVaultName": {
"type": "string"
},
"connectionStringKey": {
"type": "string"
},
"connectionString": {
"type": "string"
}
},
"resources": [
{
"type": "Microsoft.KeyVault/vaults/secrets",
"apiVersion": "2022-07-01",
"name": "[format('{0}/{1}', parameters('keyVaultName'), parameters('connectionStringKey'))]",
"properties": {
"value": "[parameters('connectionString')]"
}
}
]
}
},
"dependsOn": [
"[resourceId('Microsoft.DocumentDB/databaseAccounts', parameters('name'))]"
Expand Down

0 comments on commit 22cba59

Please sign in to comment.