Powershell DSC error – Cannot bind argument to parameter ‘ResourceKey’ because it is an empty string.

 

Background –  I was trying to deploy azure dsc extension to add ADDS role on new azure vm using ARM template (extension resource under compute resource).

 

Error – 

code”: “ResourceDeploymentFailure”,

“message”: “The resource operation completed with terminal provisioning

state ‘Failed’.”,

“details”: [

{

“code”: “VMExtensionProvisioningError”,

“message”: “VM has reported a failure when processing extension

‘Microsoft.Powershell.DSC’. Error message: \”The DSC Extension received an

incorrect input: Index operation failed; the array index evaluated to null. An

exception was raised while processing Node ‘localhost’: Index operation

failed; the array index evaluated to null.\nAt

C:\\Packages\\Plugins\\Microsoft.Powershell.DSC\\2.75.0.0\\DSCWork\\dcDc.ps1

(1).0\\dcDS.ps1

char:1\n+   Node Index operation failed; the array index

evaluated to null. Cannot bind argument to parameter ‘ResourceKey’ because it

is an empty string. Exception calling \”InvokeWithContext\” with \”2\”

argument(s): \”Cannot bind argument to parameter ‘ResourceKey’ because it is

an empty string.\” Cannot bind argument to parameter ‘ResourceKey’ because it

is an empty string.\n\nAnother common error is to specify parameters of type

PSCredential without an explicit type. Please be sure to use a typed parameter

in DSC Configuration, for example:\n\n    configuration Example {\n

param([PSCredential] $UserAccount)\n        …\n    }.\nPlease correct the

input and retry executing the extension.\”.”

 

Solution :-  in my case i forgot to pass domain name parameter which is used by DSC extension , so just added value in domainname parameter in arm parameter file and than it.

 


(Visited 250 times, 1 visits today)
, , , , , , , ,

By Arun Sabale

Arun is a Solution Architect on enterprise client management with more than 14 years of experience in IT. Arun Sabale is Blogger and tech enthusiast. His main focus is on Azure cloud infra, Cloud automation with powershell, python, ARM terraform and all cloud infra services like compute, storage, network, automation, function api etc... LinkedIN - https://www.linkedin.com/in/arun-sabale/

2 thoughts on “Powershell DSC error – Cannot bind argument to parameter ‘ResourceKey’ because it is an empty string.”
  1. Hi there, You’ve done a fantastic job. I will definitely digg it and personally suggest to my friends. I’m confident they will be benefited from this site.

Comments are closed.