Hi @sns , Thanks for posting your query on Microsoft Q&A.
This article shows you how to create more than one instance of a resource in your Azure Resource Manager template (ARM template). By adding copy loop to the resources section of your template, you can dynamically set the number of resources to deploy. You also avoid having to repeat template syntax.
Add the copy element to the resources section of your template to deploy multiple instances of the resource. The copy element has the following general format:
"copy": {
"name": "vmcopy",
"count": 5,
"mode": "serial" <or> "parallel",
}
The name property is any value that identifies the loop. The count property specifies the number of iterations you want for the resource type.
You will also need to make changes to the parameters file for each of the parameters in the template like imageSKU, vmsize, location etc.
Once you have the template and parameter files for each VM, you can deploy the template using Azure CLI (az deployment group create) or PowerShell (using New-AzResourceGroupDeployment) to create the VMs.
Here is a good example with all the details provided which will help make modifications for your scenario : https://learn.microsoft.com/en-us/azure/azure-resource-manager/templates/copy-resources#resource-iteration
However, if you have any questions specific to VM deployment, let me know in the comments and I would be happy to help.