Open LALITAMITTAL18 opened 4 years ago
According to this post, you should wrap your secrets in a json object. The correct syntax seems to be:
"secrets": {
"value": {
"array": [
{
"secretName": "exampleSecret1",
"secretValue": "secretVaule1"
},
{
"secretName": "exampleSecret2",
"secretValue": "secretValue2"
}
]
}
}
@LALITAMITTAL18 Can you check on your side?
201-key-vault-secret-create [(https://github.com/Azure/azure-quickstart-templates/tree/master/201-key-vault-secret-create)
Below is my Parameters.Json file: { "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#", "contentVersion": "1.0.0.0", "parameters": { "Vault_name":"KVCheck", "secretsObject": { "value": { "secrets": [ { "secretName": "Test1", "secretValue": "Sample Value" }, { "secretName": "Test2", "secretValue": "Sample Value" }
] } } } }
and here is my Template :
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", "contentVersion": "1.0.0.0", "parameters": { "Vault_name": { "defaultValue": "APIMSPOConnectorKeyVault", "type": "string" }
}, "variables": {}, "resources": [ { "type": "Microsoft.KeyVault/vaults", "apiVersion": "2016-10-01", "name": "[parameters('Vault_name')]", "location": "[resourceGroup().location]", "properties": { "sku": { "family": "A", "name": "Standard" }, "tenantId": "[subscription().tenantId]", "accessPolicies": [ ], "enabledForDeployment": true, "enabledForDiskEncryption": false, "enabledForTemplateDeployment": true, "enableSoftDelete": true } }, { "type": "Microsoft.KeyVault/vaults/secrets", "name": "[concat(parameters('Vault_name'), '/', parameters('secretsObject').secrets[copyIndex()].secretName)]", "apiVersion": "2018-02-14", "dependsOn": [ "[concat('Microsoft.KeyVault/vaults/', parameters('Vault_name'))]" ], "copy": { "name": "secretsCopy", "count": "[length(parameters('secretsObject').secrets)]" }, "properties": { "value": "[parameters('secretsObject').secrets[copyIndex()].secretValue]" } } ] } and its not able to recognize the object.