{
    "apiVersion": "2019-03-01",
    "type": "Microsoft.Compute/virtualMachineScaleSets",
    "name": "[parameters('vmName')]",
    "location": "[variables('location')]",
    "tags": {
        "CreatedBy": "AzureR/AzureVM"
    },
    "dependsOn": [],
    "sku": {
        "name": "[parameters('vmSize')]",
        "tier": "Standard",
        "capacity": "[parameters('instanceCount')]"
    },
    "properties": {
        "overprovision": "[parameters('overprovision')]",
        "upgradePolicy": "[parameters('upgradePolicy')]",
        "singlePlacementGroup": "[parameters('singlePlacementGroup')]",
        "virtualMachineProfile": {
            "priority": "[parameters('priority')]",
            "storageProfile": {
                "osDisk": {
                    "createOption": "FromImage",
                    "caching": "ReadWrite"
                }
            },
            "osProfile": {
                "computerNamePrefix": "[variables('vmPrefix')]",
                "adminUsername": "[parameters('adminUsername')]"
            },
            "networkProfile": {
                "networkInterfaceConfigurations": [
                    {
                        "name": "[concat(parameters('vmName'), '-nic')]",
                        "properties": {
                            "primary": "true",
                            "enableAcceleratedNetworking": "[parameters('enableAcceleratedNetworking')]",
                            "ipConfigurations": [
                                {
                                    "name": "[concat(parameters('vmName'), '-nic-ip')]",
                                    "properties": {
                                        "subnet": {
                                            "id": "[variables('subnetId')]"
                                        }
                                    }
                                }
                            ]
                        }
                    }
                ]
            }
        }
    }
}
