Create a VM from a Windows Image with 4 Empty Data Disks
{"apiversion": "2017-03-30", "type": "microsoft.compute/availabilitysets", "location": "[parameters('location')]", "name": "[parameters('gw-availabilityset')]", "properties": {"platformupdatedomaincount": 20, "platformfaultdomaincount": 2}, "sku": {"name": "aligned"}}{"name": "[concat('gw-vm-",copyindex())]", "type": "microsoft.compute/virtualmachines", "location": "[parameters('location')]", "apiversion": "2017-03-30", "copy": {"name": "gw-vm-loop", "count": "[parameters('numberofwebgwinstances')]"}, "dependson": ["[resourceid('microsoft.compute/availabilitysets", "gw-availabilityset')]", "[concat('microsoft.network/networkinterfaces/gw-",copyindex(),"-nic')]"], "properties": {"hardwareprofile": {"vmsize": "[parameters('vmsize')]"}, "availabilityset": {"id": "[resourceid('microsoft.compute/availabilitysets", "gw-availabilityset')]"}, "osprofile": {"computername": "[concat('gateway",copyindex())]", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpassword')]"}, "storageprofile": {"imagereference": {"publisher": "[variables('imagepublisher')]", "offer": "[variables('imageoffer')]", "sku": "[parameters('imagesku')]", "version": "latest"}, "osdisk": {"name": "[concat('gw-vm-",copyindex(),"_osdisk')]", "caching": "readwrite", "createoption": "fromimage", "manageddisk": {"storageaccounttype": "standardssd_lrs"}}}, "networkprofile": {"networkinterfaces": [{"id": "[resourceid('microsoft.network/networkinterfaces",concat('gw-",copyindex(),"-nic'))]"}]}}, "resources": [{"name": "[concat('gw-vm-",copyindex(),"/gateway')]", "type": "microsoft.compute/virtualmachines/extensions", "location": "[parameters('location')]", "apiversion": "2017-12-01", "dependson": ["[resourceid('microsoft.compute/virtualmachines", concat('gw-vm-",copyindex()))]"], "properties": {"publisher": "microsoft.powershell", "type": "dsc", "typehandlerversion": "2.76", "autoupgrademinorversion": true, "settings": {"modulesurl": "[concat(variables('assetlocation'),"/configuration.zip')]", "configurationfunction": "configuration.ps1\\gateway", "properties": {"domainname": "[parameters('addomainname')]", "admincreds": {"username": "[parameters('adminusername')]", "password": "privatesettingsref:adminpassword"}}}, "protectedsettings": {"items": {"adminpassword": "[parameters('adminpassword')]"}}}}, {"apiversion": "2015-06-15", "type": "microsoft.compute/virtualmachines/extensions", "name": "[concat('gw-vm-",copyindex(),"/webandgwfarmadd_postconfig1.1')]", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.compute/virtualmachines", concat('gw-vm-",copyindex()))]", "[concat('microsoft.compute/virtualmachines/gw-vm-",copyindex(),"/extensions/","gateway')]"], "properties": {"publisher": "microsoft.compute", "type": "customscriptextension", "typehandlerversion": "1.9", "autoupgrademinorversion": true, "settings": {"fileuris": ["https://raw.githubusercontent.com/azure/azure-quickstart-templates/master/application-workloads/rds/rds-deployment-ha-gateway/scripts/webandgwfarmadd_postconfig1.1.ps1"]}, "protectedsettings": {"items": {"adminpassword": "[parameters('adminpassword')]"}, "commandtoexecute": "[concat(\"powershell.exe -executionpolicy unrestricted -file\", \" \", \"webandgwfarmadd_postconfig1.1.ps1\",\" \",\"-username "\",parameters(\"adminusername\'),\"" \", \"-password "\",parameters(\"adminpassword\'),\"" \",\"-brokerserver "\",parameters(\"brokerserver\'),\"" \",\"-weburl "\",parameters(\"weburl\'),\"" \",\"-domainname "\",parameters(\"addomainname\'),\"" \",\"-domainnetbios "\",parameters(\"domainnetbios\'),\"" \",\"-numberofwebservers \",parameters(\"numberofwebgwinstances\'))]"}}}]} 