What does the "One of the deployment parameters has an empty key" mean in VSTS ARM release

Viewed 6444

My ARM template resource group deployment fails in VSTS.

I get an error without any specific reference to parameter that has an issue: "One of the deployment parameters has an empty key. Please see https://aka.ms/arm-deploy/#parameter-file for details."

The referenced url contain general information, with one comment asking the same question, but no answer to it. Person asking it alluded that it may have something to do with the version of the deployment step (2.*) and it not using Powershell anymore. I went though the template back and forth comparing parameters in BeyondCompare and nothing sticks out...

Does anyone know what does this error mean?

7 Answers

I had the same issue and found out that some parameters has a space in their values. So you should write -adminUsername "$(vmuser)". This works for me

Check Your parameter key or value does not have space in between. if your value required space then, use "". check this link.

Example,

direct value -param1 "Value with Space"

value from pipeline variables -param1 "$(valueFromVariables)".

It means you've got a parameterkey in your deployment template without a name. For example "-" instead of "-parametername" or "- parametername" (notice the space).

It can also happen if you manage to paste an 'em-dash' (e.g. from a web browser) instead of a standard dash.

We had the same as matendie; a space between the dash and the parameter name:

- pricingTier "standard"

^ note the space

In my case the problem was with template parameters override. I needed to put parameter value in quotes - "DEV" on screenshot below.

enter image description here

Ran into this the other day. The release pipeline used to be working, and it suddenly started failing continuously with this error:

Screenshot of ARM release pipeline failure

Error text:

##[error] One of the deployment parameters has an empty key. Please see https://aka.ms/resource-manager-parameter-files for details.
##[warning] Validation errors were found in the Azure Resource Manager template. This can potentially cause template deployment to fail. Task failed while creating or updating the template deployment.. Please follow https://docs.microsoft.com/en-us/azure/azure-resource-manager/templates/template-syntax
Starting Deployment.
Deployment name is TemplateDeployment-20220504-******-****
There were errors in your deployment. Error code: InvalidDeploymentParameterKey.
##[error] One of the deployment parameters has an empty key. Please see https://aka.ms/resource-manager-parameter-files for details.
##[error] Check out the troubleshooting guide to see if your issue is addressed: https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/deploy/azure-resource-group-deployment?view=azure-devops#troubleshooting
##[error] Task failed while creating or updating the template deployment.

Change that caused the error


I had changed the build pipeline such that the build numbers would now have spaces in it: so it changed from my-build-number to my build number. I was still using template param overrides this way: -buildNumber $(Build.BuildNumber): Screenshot showing override params without quotes this would expand to -buildNumber my build number, which breaks the command line processing of the ARM template deployment release task.

Solution


Used quotes for my build number variable: -buildNumber "$(Build.BuildNumber)": Screenshot showing override params with quotes

Now this would expand to -buildNumber "my build number", and the Azure Resource Manager (ARM) template deployment release task is happy:

Screenshot of release pipeline succeeding

Related