Azure / Azure/azure-quickstart-templates
KeyVault.Secret.Properties.Value not required
- Dominant language
- Bicep
- Stars
- 14.9k
- Forks
- 16.2k
- Avg merge
- 6d 21h
- Merged PRs (30d)
- 6
Description
[201-key-vault-secret-create](https://github.com/Azure/azure-quickstart-templates/blob/master/201-key-vault-secret-create/azuredeploy.json)
### Issue Details
Secret.Properties.Value is optional according to the [reference documentation](https://docs.microsoft.com/en-us/azure/templates/microsoft.keyvault/2018-02-14/vaults/secrets#SecretProperties) but if I remove it, I get an error from deploying a template
`New-AzResourceGroupDeployment : 09:25:16 - Resource Microsoft.KeyVault/vaults/secrets '/' failed with message '{
"error": {
"code": "BadRequest",
"message": "An invalid value was provided for 'value'."
}
}'`
(Apologies if this is the wrong forum but I can't comment on the reference documentation page)
### Repro steps (*if necessary, delete otherwise*)
1. Remove the value element from the JSON defining the Key Vault secret
In my case, this is what I'm trying to deploy as part of a larger ARM template...
` {
"type": "Microsoft.Resources/deployments",
"apiVersion": "2018-05-01",
"name": "[concat(variables('vLogicAppName'),'-KVSecret')]",
"dependsOn": [
"[resourceId('Microsoft.Logic/workflows', variables('vLogicAppName'))]"
],
"resourceGroup": "[variables('vSharedServicesResGrp')]",
"properties": {
"mode": "Incremental",
"template": {
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"resources": [{
"type": "Microsoft.KeyVault/vaults/secrets",
"name": "[concat(variables('vKeyVaultName'), '/',parameters('pAPICreds'))]",
"apiVersion": "2018-02-14",
"location": "[parameters('pLocation')]",
"tags": {
"displayName": "[concat(variables('vLogicAppName'),'-KVSecret')]",
"Client": "[parameters('pClient')]",
"Env": "[parameters('pEnvironment')]"
},
"properties": {
"attributes": {
"enabled": true
}
}
}]
},
"parameters": {}
}
}
`
The rationale is that the Key Vault is in a separate (shared) resource group. I define the secret but others supply the value which represents login credentials. The larger deployment adds a logic app that uses those creds during execution.
Hope that makes sense and I can get some clarification here.
Thanks in advance
Alex
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with 201-key-vault-secret-create/azuredeploy.json and the linked SecretProperties reference documentation. Reproduce the deployment after removing the properties.value element, then compare the documented optionality with the reported Azure error. Done means the required behavior is confirmed and the template or documentation discrepancy has a clear resolution.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure
- Domain
- cloud, infrastructure
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100