15

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?

Nick.Mc
  • 18,304
  • 6
  • 61
  • 91
matendie
  • 693
  • 7
  • 11
  • 2
    can you share the template? – 4c74356b41 Jul 26 '17 at 19:58
  • 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. – starian chen-MSFT Jul 28 '17 at 05:23
  • 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. – matendie Jul 28 '17 at 11:51

7 Answers7

33

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

Gclpixel
  • 331
  • 3
  • 4
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)".

Sagar Kulkarni
  • 636
  • 9
  • 24
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.

Rhys Bevilaqua
  • 2,102
  • 17
  • 20
JVGBI
  • 565
  • 1
  • 8
  • 26
2

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

- pricingTier "standard"

^ note the space

plavixo
  • 161
  • 6
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

Sachin Joseph
  • 18,928
  • 4
  • 42
  • 62
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

matendie
  • 693
  • 7
  • 11
  • 2
    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. – Tom W Jul 04 '18 at 08:14
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

Piotr Perak
  • 10,718
  • 9
  • 49
  • 86