Azure / Azure/azure-quickstart-templates
KeyVault secret doesn't support content type
- Dominant language
- Bicep
- Stars
- 14.9k
- Forks
- 16.2k
- Avg merge
- 6d 21h
- Merged PRs (30d)
- 6
Description
It seems like there isn't a way to set the content type for a key vault secret through an ARM template. This prevents people from using an ARM template to completely deploy an web app with an SSL cert that they already have. I try to set the content type below, but it doesn't actually set it.
``` javascript
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0",
"parameters": {
"keyVaultName": {
"type": "string"
},
"location": {
"type": "string",
"defaultValue": "[resourceGroup().location]"
},
"tenantId": {
"type": "string",
"defaultValue": "[subscription().tenantId]"
},
"certificate": {
"type": "securestring"
}
},
"variables": {
"apiVersion": "2015-06-01"
},
"resources": [
{
"apiVersion": "[variables('apiVersion')]",
"type": "Microsoft.KeyVault/vaults",
"name": "[parameters('keyVaultName')]",
"location": "[parameters('location')]",
"tags": {
"template": "admin-keyvault"
},
"properties": {
"sku": {
"name": "Standard",
"family": "A"
},
"tenantId": "[parameters('tenantId')]",
"accessPolicies": [ ],
"enabledForDeployment": true,
"enabledForTemplateDeployment": true
},
"resources": [
{
"apiVersion": "[variables('apiVersion')]",
"type": "secrets",
"name": "test-cert",
"dependsOn": [ "[resourceId('Microsoft.KeyVault/vaults', parameters('keyVaultName'))]" ],
"properties": { "value": "[parameters('certificate')]", "contentType": "application/x-pkcs12" }
}
]
}
]
}
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reproducing the supplied ARM template with the Microsoft.KeyVault/vaults secrets resource and inspect whether the contentType property is retained. Check the Azure Key Vault API behavior for the 2015-06-01 version. Done means an ARM deployment can create test-cert with contentType set to application/x-pkcs12.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure
- Domain
- cloud, security
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100