Norrin Rad
Norrin Rad

Reputation: 991

Unable to Add DSC Extension JSON ARM

I'm trying to add an extension to an azure arm template, so when it loops around it adds the extension to each vm.

The full JSON is at the link below: https://pastebin.com/embed_iframe/7uvwdZ6e

The error I'm getting is:

Error: Code=InvalidTemplate; Message=Deployment template validation failed: 'The resource 'Microsoft.Compute/virtualMachines/vmt1dsc/extensions/CreateADPDC' at line 
'0' and column '0' is defined multiple times in a template.

CreateADPDC' is the name of the extension.

Thanks in advance :)

Upvotes: 2

Views: 50

Answers (1)

4c74356b41
4c74356b41

Reputation: 72171

your dsc extension (line 444, I believe) is this (and because of that it complains it is defined multipli times):

"name": "[concat(parameters('VMNames'),'/',parameters('vmNameDscConfig'))]",

but should be this:

"name": "[parameters('vmNameDscConfig')]",

small remark, you need full name\type for "sub" resource (think subnet, vm extension, nsg rule, etc) if you are declaring it as a stand alone resource, but yours is a nested resource of the VM resource, so type should be extensions, just like with other extensions, not:

"type": "Microsoft.Compute/virtualMachines/extensions",

Upvotes: 1

Related Questions