question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Template validation reports parameter value not specified when it uses a keyvault reference

See original GitHub issue

Hi,

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:closed
  • Created 3 years ago
  • Comments:19 (9 by maintainers)

github_iconTop GitHub Comments

2reactions
StephenWeatherfordcommented, Jun 6, 2020

Correct, forgot to add the “fixed in next release” label. Probably will be out within two weeks.

2reactions
neilpetersoncommented, Apr 28, 2020

@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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found