I am creating a VM in Azure through ARM Template using an existing image. The image already has a datadisk. I am trying to add additional data-disks through ARM Template while creating the VM. Can I do so ? I am getting below listed error:-
Can not add property dataDisks to Newtonsoft.Json.Linq.JObject. Property with the same name already exists on object
Well, if your image already has data disks, then when you create the VM through the ARM template, you need also configure the
datadisk
block for the existing data disk. Just set thecreateOption
with the valuefromImage
. Then set the additional data disk as usual. For example, your image has one data disk, and you also need to attach another data disk, then thedataDisk
block would like this:It's just an example, you can change the values as you need, the most important thing for you is the
createOption
. And the first is for the existing data disk, the same type, and other things also should be the same as it is in the image.