203 строки
7.8 KiB
JSON
203 строки
7.8 KiB
JSON
{
|
|
"contentVersion": "1.0.0.0",
|
|
"$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
|
|
"parameters": {
|
|
"adminUsername": {
|
|
"type": "string",
|
|
"metadata": {
|
|
"description": "Username for the Virtual Machine"
|
|
}
|
|
},
|
|
"adminPassword": {
|
|
"type": "securestring",
|
|
"metadata": {
|
|
"description": "Password for the Virtual Machine"
|
|
}
|
|
},
|
|
"vmName": {
|
|
"type": "string",
|
|
"metadata": {
|
|
"description": "Name for the Virtual Machine"
|
|
}
|
|
},
|
|
"vmSize": {
|
|
"type": "string",
|
|
"metadata": {
|
|
"description": "Size for the Virtual Machine"
|
|
}
|
|
}
|
|
},
|
|
"variables": {
|
|
"apiVersion": "2015-10-01",
|
|
"location": "[resourceGroup().location]",
|
|
"imagePublisher": "microsoft-ads",
|
|
"imageOffer": "windows-data-science-vm",
|
|
"sku": "windows2016",
|
|
"version": "03.25.19",
|
|
"OSDiskName": "osdiskforwindowssimple",
|
|
"nicName": "[parameters('vmName')]",
|
|
"addressPrefix": "10.0.0.0/16",
|
|
"subnetName": "Subnet",
|
|
"subnetPrefix": "10.0.0.0/24",
|
|
"storageAccountType": "Standard_LRS",
|
|
"storageAccountName": "[concat(uniquestring(resourceGroup().id), 'windsvm')]",
|
|
"publicIPAddressType": "Dynamic",
|
|
"publicIPAddressName": "[tolower(concat('co',parameters('vmName'),uniquestring(resourceGroup().id)))]",
|
|
"vmStorageAccountContainerName": "vhds",
|
|
"vmName": "[parameters('vmName')]",
|
|
"vmSize": "[parameters('vmSize')]",
|
|
"virtualNetworkName": "[parameters('vmName')]",
|
|
"vnetID": "[resourceId('Microsoft.Network/virtualNetworks',variables('virtualNetworkName'))]",
|
|
"subnetRef": "[concat(variables('vnetID'),'/subnets/',variables('subnetName'))]"
|
|
},
|
|
"resources": [
|
|
{
|
|
"type": "Microsoft.Storage/storageAccounts",
|
|
"name": "[variables('storageAccountName')]",
|
|
"apiVersion": "2015-05-01-preview",
|
|
"location": "[variables('location')]",
|
|
"properties": {
|
|
"accountType": "[variables('storageAccountType')]"
|
|
}
|
|
},
|
|
{
|
|
"apiVersion": "2015-05-01-preview",
|
|
"type": "Microsoft.Network/publicIPAddresses",
|
|
"name": "[variables('publicIPAddressName')]",
|
|
"location": "[variables('location')]",
|
|
"properties": {
|
|
"publicIPAllocationMethod": "[variables('publicIPAddressType')]",
|
|
"dnsSettings": {
|
|
"domainNameLabel": "[variables('publicIPAddressName')]"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"apiVersion": "2015-05-01-preview",
|
|
"type": "Microsoft.Network/virtualNetworks",
|
|
"name": "[variables('virtualNetworkName')]",
|
|
"location": "[variables('location')]",
|
|
"properties": {
|
|
"addressSpace": {
|
|
"addressPrefixes": [
|
|
"[variables('addressPrefix')]"
|
|
]
|
|
},
|
|
"subnets": [
|
|
{
|
|
"name": "[variables('subnetName')]",
|
|
"properties": {
|
|
"addressPrefix": "[variables('subnetPrefix')]"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"apiVersion": "2015-05-01-preview",
|
|
"type": "Microsoft.Network/networkInterfaces",
|
|
"name": "[variables('nicName')]",
|
|
"location": "[variables('location')]",
|
|
"dependsOn": [
|
|
"[concat('Microsoft.Network/publicIPAddresses/', variables('publicIPAddressName'))]",
|
|
"[concat('Microsoft.Network/virtualNetworks/', variables('virtualNetworkName'))]"
|
|
],
|
|
"properties": {
|
|
"ipConfigurations": [
|
|
{
|
|
"name": "ipconfig1",
|
|
"properties": {
|
|
"privateIPAllocationMethod": "Dynamic",
|
|
"publicIPAddress": {
|
|
"id": "[resourceId('Microsoft.Network/publicIPAddresses',variables('publicIPAddressName'))]"
|
|
},
|
|
"subnet": {
|
|
"id": "[variables('subnetRef')]"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"apiVersion": "2015-06-15",
|
|
"type": "Microsoft.Compute/virtualMachines",
|
|
"name": "[parameters('vmName')]",
|
|
"location": "[variables('location')]",
|
|
"plan": {
|
|
"name": "[variables('sku')]",
|
|
"publisher": "[variables('imagePublisher')]",
|
|
"product": "[variables('imageOffer')]"
|
|
},
|
|
"tags": {
|
|
"Application": "DataScience"
|
|
},
|
|
"dependsOn": [
|
|
"[concat('Microsoft.Storage/storageAccounts/', variables('storageAccountName'))]",
|
|
"[concat('Microsoft.Network/networkInterfaces/', variables('nicName'))]"
|
|
],
|
|
"properties": {
|
|
"hardwareProfile": {
|
|
"vmSize": "[variables('vmSize')]"
|
|
},
|
|
"osProfile": {
|
|
"computerName": "[parameters('vmName')]",
|
|
"adminUsername": "[parameters('adminUsername')]",
|
|
"adminPassword": "[parameters('adminPassword')]"
|
|
},
|
|
"storageProfile": {
|
|
"imageReference": {
|
|
"publisher": "[variables('imagePublisher')]",
|
|
"offer": "[variables('imageOffer')]",
|
|
"sku": "[variables('sku')]",
|
|
"version": "[variables('version')]"
|
|
},
|
|
"osDisk": {
|
|
"name": "osdisk",
|
|
"vhd": {
|
|
"uri": "[concat('http://',variables('storageAccountName'),'.blob.core.windows.net/',variables('vmStorageAccountContainerName'),'/',variables('OSDiskName'), parameters('vmName'), '.vhd')]"
|
|
},
|
|
"caching": "ReadWrite",
|
|
"createOption": "FromImage"
|
|
}
|
|
},
|
|
"networkProfile": {
|
|
"networkInterfaces": [
|
|
{
|
|
"id": "[resourceId('Microsoft.Network/networkInterfaces',variables('nicName'))]"
|
|
}
|
|
]
|
|
},
|
|
"diagnosticsProfile": {
|
|
"bootDiagnostics": {
|
|
"enabled": "true",
|
|
"storageUri": "[concat('http://',variables('storageAccountName'),'.blob.core.windows.net')]"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"outputs": {
|
|
"vmUrl": {
|
|
"value": "[concat('https://ms.portal.azure.com/#resource/subscriptions/', subscription().subscriptionId, '/resourceGroups/', resourceGroup().name, '/providers/Microsoft.Compute/virtualMachines/', parameters('vmName'))]",
|
|
"type": "string"
|
|
},
|
|
"vmFqdn": {
|
|
"value": "[reference( variables('publicIPAddressName')).dnsSettings.fqdn]",
|
|
"type": "string"
|
|
},
|
|
"vmAdminUsername": {
|
|
"value": "[parameters('adminUsername')]",
|
|
"type": "string"
|
|
},
|
|
"vmAdminPassword": {
|
|
"value": "[parameters('adminPassword')]",
|
|
"type": "string"
|
|
},
|
|
"sqlServerName": {
|
|
"value": "[parameters('vmName')]",
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|