Template validation reports parameter value not specified when it uses a keyvault reference
See original GitHub issueHi,
This is more of a nit as I haven’t been blocked by this error. In VSCode, I have a parameter for a storage prefix (which comes from the parameter file); that is then referenced in a variable which concats it with a uniqueString
azuredeploy.json
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"location": {
"type": "string",
"defaultValue": "[resourceGroup().location]",
"metadata": {
"description": "Location where resource(s) will be created"
}
},
"storagePrefix": {
"type": "string",
"minLength": 3,
"maxLength": 11
},
"storageSKU": {
"type": "string",
"defaultValue": "Standard_LRS",
"allowedValues": [
"Standard_LRS",
"Standard_GRS",
"Standard_RAGRS",
"Standard_ZRS",
"Premium_LRS",
"Premium_ZRS",
"Standard_GZRS",
"Standard_RAGZRS"
]
}
},
"variables": {
"uniqueStorageName": "[concat(parameters('storagePrefix'), uniqueString(resourceGroup().id))]"
},
"resources": [
{
"type": "Microsoft.Storage/storageAccounts",
"apiVersion": "2019-06-01",
"name": "[variables('uniqueStorageName')]",
"location": "[parameters('location')]",
"sku": {
"name": "[parameters('storageSKU')]"
},
"kind": "StorageV2",
"properties": {
"networkAcls": {
"bypass": "AzureServices",
"virtualNetworkRules": [],
"ipRules": [],
"defaultAction": "Allow"
},
"supportsHttpsTrafficOnly": true,
"encryption": {
"services": {
"file": {
"keyType": "Account",
"enabled": true
},
"blob": {
"keyType": "Account",
"enabled": true
}
},
"keySource": "Microsoft.Storage"
},
"accessTier": "Hot"
}
}
]
}
azuredepoy.parameters.dev.json
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"location": {
"value": "westus"
},
"storagePrefix": {
"value": "stcmadcm"
},
"storageSKU": {
"value": "Standard_LRS"
}
}
}
The deployment, both in test and prod work fine without any errors, however within VS Code I get this error in the PROBLEMS tab
Template validation failed: The value for the template parameter 'storagePrefix' at line '12' and column '26' is not provided. Please see https://aka.ms/arm-deploy/#parameter-file for usage details.
I do have the latest version of VSCode installed.
Let me know if there is anything else I can provide to help with this
Issue Analytics
- State:
- Created 3 years ago
- Comments:19 (9 by maintainers)
Top Results From Across the Web
Use Key Vault references - Azure App Service - Microsoft Learn
Key Vault references will use the app's system assigned identity by default, but you can specify a user-assigned identity.
Read more >Error & Fix: ARM Linked Template 'Invalid Template .. could ...
The error is correct in stating 'The template reference 'rkfunctionapp-keyvault' is not valid: could not find template resource or resource ...
Read more >referencing a KeyVault secret in an ARM template fails with ...
But when I use that to reference the secret I keep getting a validation error which says: Error: Code=InvalidTemplate; Message=Deployment ...
Read more >Use Key Vaults to Store App Service Application Secrets
If there are no application settings with the Source set to Key vault Reference (displaying a green 'tick'), the Azure Key Vault service...
Read more >Accessing Key Vault Secrets from ARM Templates - LinkedIn
Never, ever, ever, ever store credentials in code! This also applies to Azure ARM Templates. Yes, you can specify credentials as Parameter ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Correct, forgot to add the “fixed in next release” label. Probably will be out within two weeks.
@BillzGitHub fix has been completed. We will try and get this into the next release but may be cutting it close. Will update here once we know.
Thanks again.