{ "$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json", "contentVersion": "1.0.0.0", "parameters": { "vmSku": { "type": "string", "defaultValue": "Standard_D2s_v3", "metadata": { "description": "Size of VMs in the VM Scale Set." } }, "vmssName": { "type": "string", "metadata": { "description": "String used as a base for naming resources (9 characters or less). A hash is prepended to this string for some resources, and resource-specific information is appended." }, "maxLength": 9 }, "instanceCount": { "type": "int", "metadata": { "description": "Number of VM instances (100 or less)." }, "maxValue": 100 }, "adminUsername": { "type": "string", "metadata": { "description": "Admin username on all VMs." } }, "adminPassword": { "type": "securestring", "metadata": { "description": "Admin password on all VMs." } }, "storageAccountName": { "type": "string", "defaultValue": "myshareddisk", "metadata": { "description": "Storage account name for Azure file share." } }, "storageAccountKey": { "type": "securestring", "metadata": { "description": "Storage account key for Azure file share." } }, "shareName": { "type": "string", "defaultValue": "dsvmshare", "metadata": { "description": "Azure file share name." } }, "mountpointPath": { "type": "string", "defaultValue": "/datamnt/dsvmshare", "metadata": { "description": "Path on VM to mount file share - will also link to user home dir." } } }, "variables": { "location": "[resourceGroup().location]", "subnetName": "dsvmcluster", "virtualNetworkName": "[concat(parameters('vmssName'), '-vnet')]", "publicIPAddressName": "[concat(parameters('vmssName'), 'pip')]", "publicIPAddressID": "[resourceId('Microsoft.Network/publicIPAddresses',variables('publicIPAddressName'))]", "vnetID": "[resourceId('Microsoft.Network/virtualNetworks',variables('virtualNetworkName'))]", "subnetRef": "[concat(variables('vnetId'), '/subnets/', variables('subnetName'))]", "addressPrefix": "10.0.0.0/16", "subnetPrefix": "10.0.0.0/24", "loadBalancerName": "[concat(parameters('vmssName'), 'lb')]", "lbID": "[resourceId('Microsoft.Network/loadBalancers',variables('loadBalancerName'))]", "natPoolName": "[concat(parameters('vmssName'), 'sshnat')]", "bePoolName": "[concat(parameters('vmssName'), 'bepool')]", "natStartPort": 50000, "natEndPort": 50120, "natBackendPort": 22, "nicName": "[concat(parameters('vmssName'), 'nic')]", "ipConfigName": "[concat(parameters('vmssName'), 'ipconfig')]", "frontEndIPConfigID": "[concat(variables('lbID'),'/frontendIPConfigurations/loadBalancerFrontEnd')]", "lbProbeIDjupyter": "[concat(variables('lbID'),'/probes/Jupyterprobe')]", "lbProbeIDssh": "[concat(variables('lbID'),'/probes/sshprobe')]", "osType": { "publisher": "microsoft-ads", "offer": "linux-data-science-vm-ubuntu", "sku": "linuxdsvmubuntu", "version": "latest" }, "imageReference": "[variables('osType')]", "computeApiVersion": "2017-03-30", "networkApiVersion": "2017-04-01", "insightsApiVersion": "2015-04-01" }, "resources": [ { "apiVersion": "2017-06-01", "type": "Microsoft.Network/virtualNetworks", "name": "[variables('virtualNetworkName')]", "location": "[variables('location')]", "properties": { "addressSpace": { "addressPrefixes": [ "[variables('addressPrefix')]" ] }, "subnets": [ { "name": "[variables('subnetName')]", "properties": { "addressPrefix": "[variables('subnetPrefix')]" } } ] } }, { "type": "Microsoft.Network/publicIPAddresses", "name": "[variables('publicIPAddressName')]", "location": "[variables('location')]", "apiVersion": "2017-04-01", "properties": { "publicIPAllocationMethod": "Dynamic" } }, { "type": "Microsoft.Network/loadBalancers", "name": "[variables('loadBalancerName')]", "location": "[variables('location')]", "apiVersion": "2017-06-01", "dependsOn": [ "[concat('Microsoft.Network/publicIPAddresses/', variables('publicIPAddressName'))]" ], "properties": { "frontendIPConfigurations": [ { "name": "LoadBalancerFrontEnd", "properties": { "publicIPAddress": { "id": "[variables('publicIPAddressID')]" } } } ], "backendAddressPools": [ { "name": "[variables('bePoolName')]" } ], "loadBalancingRules":[ { "name": "Jupyter", "properties": { "frontendIPConfiguration": { "id": "[variables('frontEndIPConfigID')]" }, "backendAddressPool": { "id": "[concat('/subscriptions/', subscription().subscriptionId,'/resourceGroups/', resourceGroup().name, '/providers/Microsoft.Network/loadBalancers/', variables('loadBalancerName'), '/backendAddressPools/', variables('bePoolName'))]" }, "protocol": "Tcp", "frontendPort": 8000, "backendPort": 8000, "loadDistribution": "SourceIP", "enableFloatingIP": false, "idleTimeoutInMinutes": 30, "probe": { "id": "[variables('lbProbeIDjupyter')]" } } }, { "name": "SSH", "properties": { "frontendIPConfiguration": { "id": "[variables('frontEndIPConfigID')]" }, "backendAddressPool": { "id": "[concat('/subscriptions/', subscription().subscriptionId,'/resourceGroups/', resourceGroup().name, '/providers/Microsoft.Network/loadBalancers/', variables('loadBalancerName'), '/backendAddressPools/', variables('bePoolName'))]" }, "protocol": "Tcp", "frontendPort": 22, "backendPort": 22, "loadDistribution": "SourceIP", "enableFloatingIP": false, "idleTimeoutInMinutes": 30, "probe": { "id": "[variables('lbProbeIDssh')]" } } } ], "probes": [ { "name": "Jupyterprobe", "properties": { "protocol": "Tcp", "port": 8000, "intervalInSeconds": 5, "numberOfProbes": 2 } }, { "name": "sshprobe", "properties": { "protocol": "Tcp", "port": 22, "intervalInSeconds": 5, "numberOfProbes": 2 } } ] } }, { "type": "Microsoft.Compute/virtualMachineScaleSets", "name": "[parameters('vmssName')]", "location": "[variables('location')]", "plan": { "name": "linuxdsvmubuntu", "publisher": "microsoft-ads", "product": "linux-data-science-vm-ubuntu" }, "apiVersion": "2017-03-30", "dependsOn": [ "[concat('Microsoft.Network/loadBalancers/', variables('loadBalancerName'))]" ], "sku": { "name": "[parameters('vmSku')]", "tier": "Standard", "capacity": "[parameters('instanceCount')]" }, "properties": { "overprovision": false, "upgradePolicy": { "mode": "Manual" }, "virtualMachineProfile": { "storageProfile": { "osDisk": { "createOption": "FromImage", "caching": "ReadWrite" }, "imageReference": "[variables('imageReference')]" }, "osProfile": { "computerNamePrefix": "[parameters('vmssName')]", "adminUsername": "[parameters('adminUsername')]", "adminPassword": "[parameters('adminPassword')]" }, "networkProfile": { "networkInterfaceConfigurations": [ { "name": "[variables('nicName')]", "properties": { "primary": true, "ipConfigurations": [ { "name": "[variables('ipConfigName')]", "properties": { "subnet": { "id": "[variables('subnetRef')]" }, "loadBalancerBackendAddressPools": [ { "id": "[concat('/subscriptions/', subscription().subscriptionId,'/resourceGroups/', resourceGroup().name, '/providers/Microsoft.Network/loadBalancers/', variables('loadBalancerName'), '/backendAddressPools/', variables('bePoolName'))]" } ] } } ] } } ] }, "extensionProfile": { "extensions": [ { "name": "filesextension", "properties": { "publisher": "Microsoft.Azure.Extensions", "type": "CustomScript", "typeHandlerVersion": "2.0", "autoUpgradeMinorVersion": true, "settings": { "fileUris": [ "https://raw.githubusercontent.com/Azure/DataScienceVM/master/Extensions/General/mountazurefiles.sh" ], "commandToExecute": "[concat('bash mountazurefiles.sh ', parameters('storageAccountName'), ' ', parameters('storageAccountKey'), ' ', parameters('shareName'), ' ', parameters('mountpointPath'), ' ', parameters('adminUsername'))]" } } } ] } } } } ] }