{ "$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json", "contentVersion": "1.0.0.0", "parameters": { "adminUsername": { "type": "string" }, "adminPassword": { "type": "securestring" }, "sourceImageVhdUri": { "type": "string", "metadata": { "description": "The source of the generalized blob containing the custom image" } } }, "variables": {}, "resources": [ { "type": "Microsoft.Compute/images", "apiVersion": "2016-04-30-preview", "name": "myCustomImage", "location": "[resourceGroup().location]", "properties": { "storageProfile": { "osDisk": { "osType": "Linux", "osState": "Generalized", "blobUri": "[parameters('sourceImageVhdUri')]", "storageAccountType": "Standard_LRS" } } } }, { "type": "Microsoft.Network/virtualNetworks", "name": "myVnet", "location": "[resourceGroup().location]", "apiVersion": "2016-12-01", "properties": { "addressSpace": { "addressPrefixes": [ "10.0.0.0/16" ] }, "subnets": [ { "name": "mySubnet", "properties": { "addressPrefix": "10.0.0.0/16" } } ] } }, { "type": "Microsoft.Compute/virtualMachineScaleSets", "name": "myScaleSet", "location": "[resourceGroup().location]", "apiVersion": "2016-04-30-preview", "dependsOn": [ "Microsoft.Network/virtualNetworks/myVnet", "Microsoft.Compute/images/myCustomImage" ], "sku": { "name": "Standard_A1", "capacity": 2 }, "properties": { "upgradePolicy": { "mode": "Manual" }, "virtualMachineProfile": { "storageProfile": { "imageReference": { "id": "[resourceId('Microsoft.Compute/images', 'myCustomImage')]" } }, "osProfile": { "computerNamePrefix": "vm", "adminUsername": "[parameters('adminUsername')]", "adminPassword": "[parameters('adminPassword')]" }, "networkProfile": { "networkInterfaceConfigurations": [ { "name": "myNic", "properties": { "primary": "true", "ipConfigurations": [ { "name": "myIpConfig", "properties": { "subnet": { "id": "[concat(resourceId('Microsoft.Network/virtualNetworks', 'myVnet'), '/subnets/mySubnet')]" } } } ] } } ] } } } } ] }