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

8

16

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?

Capricecapricious answered 26/7, 2017 at 18:36 Comment(3)
can you share the template?Counterpoison
What's the result if you deploy it manually on your machine? Can you provide the template code? Try to set system.debug to true (variable), then check whether there is detail error message after building.Anaclitic
I will try deploying it from my local machine to Azure, but its an infrastructure ARM template so there is no building it... this ARM template has over 300 lines, which is too long to paste in here.Capricecapricious
M
34

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

Melodics answered 15/5, 2018 at 20:28 Comment(0)
J
6

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)".

Jaguar answered 30/8, 2019 at 11:54 Comment(0)
D
3

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.

Doggoned answered 3/12, 2019 at 13:17 Comment(0)
U
2

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

- pricingTier "standard"

^ note the space

Unbalanced answered 7/1, 2019 at 17:52 Comment(0)
K
1

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://learn.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://learn.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

Kirkendall answered 5/5, 2022 at 19:28 Comment(0)
C
0

So, I'm not sure what the issue was, but I gave up on trying to identify the problem, and I deleted the release definition. Recreating it from scratch using the same template, works fine now...

Maybe the definition got some how corrupted. Not sure, but new one is not having this issue.

Thanks

Capricecapricious answered 28/7, 2017 at 14:24 Comment(1)
This is beyond infuriating. I'm having a similar issue on a release that worked; I changed an environment variable - to an allowed value - and the release is now failing to deploy an ARM template that is identical to the previous release that worked, with the same message.Squadron
A
0

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

Adah answered 14/1, 2020 at 10:15 Comment(0)
D
0

In my case I had added a newline for each parameter ovverrides which resulted in loads of:

There was an error while overriding '' parameter because of 'TypeError: Cannot read properties of undefined...

Once I deleted the newline character and had all paramter overrides on one line I got rid of this error.

Im using a release pipeline and the "ARM Template deployment"-task and pressing the ellipses next to the field "Ovverride template parameters". Instead of editing in the narrow window I pressed OK and copied the field content to a texteditor and added newlines for readability (WRONG!). Then pasted the edited text into the field in the release pipeline again.

Dar answered 25/3, 2024 at 13:18 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.