{ "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", "contentVersion": "1.0.0.0", "parameters": { "windowsImagePublisher": { "type": "string", "metadata": { "description": "The Publisher of Windows Image" }, "defaultValue": "MicrosoftWindowsServer" }, "windowsImageOffer": { "type": "string", "metadata": { "description": "The offer of Windows Image" }, "defaultValue": "WindowsServer" }, "windowsImageSKU": { "type": "string", "metadata": { "description": "The SKU Name of Windows Image" }, "defaultValue": "2016-Datacenter" }, "windowsImageVersion": { "type": "string", "metadata": { "description": "The Version of Windows Image" }, "defaultValue": "latest" }, "sqlDiskSize": { "type": "int", "metadata": { "description": "The Size of SQL VM data disk. Default 2 GB" }, "defaultValue": 2 }, "vmName": { "type": "string", "metadata": { "description": "The VM Name" } }, "storageAccount": { "type": "string", "metadata": { "description": "The Storage Account Name" } }, "storageAccountType": { "type": "string", "metadata": { "description": "The type of the Storage Account created" }, "defaultValue": "Standard_LRS" }, "adminUsername": { "type": "string", "metadata": { "description": "The name of the Administrator of the new VMs and Domain" } }, "adminPassword": { "type": "securestring", "metadata": { "description": "The password for the Administrator account of the new VMs and Domain" } }, "vmSize": { "type": "string", "metadata": { "description": "The size of the AD VMs Created" }, "defaultValue": "Standard_A3" }, "subnetResourceId": { "type": "string", "metadata": { "description": "the resource id to the subnet" } }, "sqlNicName": { "type": "string", "metadata": { "description": "Name of the Nic attached to the SQL VM" } } }, "variables": { "location": "[resourceGroup().location]", "vmContainerName": "vhds" }, "resources": [ { "name": "[parameters('storageAccount')]", "type": "Microsoft.Storage/storageAccounts", "location": "[variables('location')]", "apiVersion": "2015-06-15", "properties": { "accountType": "[parameters('storageAccountType')]" } }, { "name": "[parameters('sqlNicName')]", "type": "Microsoft.Network/networkInterfaces", "location": "[variables('location')]", "apiVersion": "2015-05-01-preview", "properties": { "ipConfigurations": [ { "name": "ipconfig1", "properties": { "privateIPAllocationMethod": "Dynamic", "subnet": { "id": "[parameters('subnetResourceId')]" } } } ] } }, { "name": "[parameters('vmName')]", "type": "Microsoft.Compute/virtualMachines", "location": "[variables('location')]", "apiVersion": "2015-06-15", "dependsOn": [ "[resourceId('Microsoft.Storage/storageAccounts',parameters('storageAccount'))]", "[resourceId('Microsoft.Network/networkInterfaces',parameters('sqlNicName'))]" ], "properties": { "hardwareProfile": { "vmSize": "[parameters('vmSize')]" }, "osProfile": { "computerName": "[parameters('vmName')]", "adminUsername": "[parameters('adminUsername')]", "adminPassword": "[parameters('adminPassword')]" }, "storageProfile": { "imageReference": { "publisher": "[parameters('windowsImagePublisher')]", "offer": "[parameters('windowsImageOffer')]", "sku": "[parameters('windowsImageSKU')]", "version": "[parameters('windowsImageVersion')]" }, "osDisk": { "name": "osdisk", "vhd": { "uri": "[concat(reference(concat('Microsoft.Storage/storageAccounts/', parameters('storageAccount')),providers('Microsoft.Storage', 'storageAccounts').apiVersions[0]).primaryEndpoints.blob, variables('vmContainerName'),'/', parameters('vmName'), '0','-osdisk.vhd')]" }, "caching": "ReadWrite", "createOption": "FromImage" }, "dataDisks": [ { "vhd": { "uri": "[concat(reference(concat('Microsoft.Storage/storageAccounts/', parameters('storageAccount')),providers('Microsoft.Storage','storageAccounts').apiVersions[0]).primaryEndpoints.blob, variables('vmContainerName'),'/',parameters('vmName'),'0','-data-1.vhd')]" }, "name": "[concat(parameters('vmName'), '0','data-1.vhd')]", "caching": "None", "createOption": "Empty", "diskSizeGB": "[parameters('sqlDiskSize')]", "lun": 0 }, { "vhd": { "uri": "[concat(reference(concat('Microsoft.Storage/storageAccounts/', parameters('storageAccount')),providers('Microsoft.Storage','storageAccounts').apiVersions[0]).primaryEndpoints.blob,variables('vmContainerName'),'/', parameters('vmName'), '0','log-1.vhd')]" }, "name": "[concat(parameters('vmName'), '0','log-1.vhd')]", "caching": "None", "createOption": "Empty", "diskSizeGB": "[parameters('sqlDiskSize')]", "lun": 1 } ] }, "networkProfile": { "networkInterfaces": [ { "id": "[resourceId('Microsoft.Network/networkInterfaces',parameters('sqlNicName'))]" } ] } } } ], "outputs": { } }