2016-07-11 17:36:49 -04:00
|
|
|
{
|
|
|
|
"$schema": "http://schema.management.azure.com/schemas/2014-04-01-preview/deploymentTemplate.json",
|
|
|
|
"contentVersion": "1.0.0.0",
|
|
|
|
"parameters": {
|
|
|
|
"adminPassword": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"adminUsername": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"dnsNameForPublicIP": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
2018-03-10 14:17:43 -05:00
|
|
|
"nicName": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
2016-07-11 17:36:49 -04:00
|
|
|
"osDiskName": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
2018-03-10 14:17:43 -05:00
|
|
|
"publicIPAddressName": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
2016-07-11 17:36:49 -04:00
|
|
|
"storageAccountBlobEndpoint": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
2018-03-10 14:17:43 -05:00
|
|
|
"subnetName": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"virtualNetworkName": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
2016-07-11 17:36:49 -04:00
|
|
|
"vmName": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"vmSize": {
|
|
|
|
"type": "string"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"resources": [
|
|
|
|
{
|
2017-05-29 00:06:09 -04:00
|
|
|
"apiVersion": "[variables('publicIPAddressApiVersion')]",
|
2016-07-11 17:36:49 -04:00
|
|
|
"location": "[variables('location')]",
|
2018-03-10 14:17:43 -05:00
|
|
|
"name": "[parameters('publicIPAddressName')]",
|
2016-07-11 17:36:49 -04:00
|
|
|
"properties": {
|
|
|
|
"dnsSettings": {
|
|
|
|
"domainNameLabel": "[parameters('dnsNameForPublicIP')]"
|
|
|
|
},
|
|
|
|
"publicIPAllocationMethod": "[variables('publicIPAddressType')]"
|
|
|
|
},
|
|
|
|
"type": "Microsoft.Network/publicIPAddresses"
|
|
|
|
},
|
|
|
|
{
|
2017-05-29 00:06:09 -04:00
|
|
|
"apiVersion": "[variables('virtualNetworksApiVersion')]",
|
2016-07-11 17:36:49 -04:00
|
|
|
"location": "[variables('location')]",
|
|
|
|
"name": "[variables('virtualNetworkName')]",
|
|
|
|
"properties": {
|
|
|
|
"addressSpace": {
|
|
|
|
"addressPrefixes": [
|
|
|
|
"[variables('addressPrefix')]"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"subnets": [
|
|
|
|
{
|
|
|
|
"name": "[variables('subnetName')]",
|
|
|
|
"properties": {
|
|
|
|
"addressPrefix": "[variables('subnetAddressPrefix')]"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"type": "Microsoft.Network/virtualNetworks"
|
|
|
|
},
|
|
|
|
{
|
2017-05-29 00:06:09 -04:00
|
|
|
"apiVersion": "[variables('networkInterfacesApiVersion')]",
|
2016-07-11 17:36:49 -04:00
|
|
|
"dependsOn": [
|
2018-03-10 14:17:43 -05:00
|
|
|
"[concat('Microsoft.Network/publicIPAddresses/', parameters('publicIPAddressName'))]",
|
2016-07-11 17:36:49 -04:00
|
|
|
"[concat('Microsoft.Network/virtualNetworks/', variables('virtualNetworkName'))]"
|
|
|
|
],
|
|
|
|
"location": "[variables('location')]",
|
2018-03-10 14:17:43 -05:00
|
|
|
"name": "[parameters('nicName')]",
|
2016-07-11 17:36:49 -04:00
|
|
|
"properties": {
|
|
|
|
"ipConfigurations": [
|
|
|
|
{
|
|
|
|
"name": "ipconfig",
|
|
|
|
"properties": {
|
|
|
|
"privateIPAllocationMethod": "Dynamic",
|
|
|
|
"publicIPAddress": {
|
2018-03-10 14:17:43 -05:00
|
|
|
"id": "[resourceId('Microsoft.Network/publicIPAddresses', parameters('publicIPAddressName'))]"
|
2016-07-11 17:36:49 -04:00
|
|
|
},
|
|
|
|
"subnet": {
|
|
|
|
"id": "[variables('subnetRef')]"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"type": "Microsoft.Network/networkInterfaces"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"apiVersion": "[variables('apiVersion')]",
|
|
|
|
"dependsOn": [
|
2018-03-10 14:17:43 -05:00
|
|
|
"[concat('Microsoft.Network/networkInterfaces/', parameters('nicName'))]"
|
2016-07-11 17:36:49 -04:00
|
|
|
],
|
|
|
|
"location": "[variables('location')]",
|
|
|
|
"name": "[parameters('vmName')]",
|
|
|
|
"properties": {
|
|
|
|
"diagnosticsProfile": {
|
|
|
|
"bootDiagnostics": {
|
|
|
|
"enabled": false
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"hardwareProfile": {
|
|
|
|
"vmSize": "[parameters('vmSize')]"
|
|
|
|
},
|
|
|
|
"networkProfile": {
|
|
|
|
"networkInterfaces": [
|
|
|
|
{
|
2018-03-10 14:17:43 -05:00
|
|
|
"id": "[resourceId('Microsoft.Network/networkInterfaces', parameters('nicName'))]"
|
2016-07-11 17:36:49 -04:00
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"osProfile": {
|
|
|
|
"adminPassword": "[parameters('adminPassword')]",
|
|
|
|
"adminUsername": "[parameters('adminUsername')]",
|
|
|
|
"computerName": "[parameters('vmName')]",
|
|
|
|
"linuxConfiguration": {
|
|
|
|
"ssh": {
|
|
|
|
"publicKeys": [
|
|
|
|
{
|
|
|
|
"keyData": "",
|
|
|
|
"path": "[variables('sshKeyPath')]"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"storageProfile": {
|
|
|
|
"osDisk": {
|
|
|
|
"caching": "ReadWrite",
|
|
|
|
"createOption": "FromImage",
|
|
|
|
"image": {
|
|
|
|
"uri": "https://localhost/custom.vhd"
|
|
|
|
},
|
|
|
|
"name": "osdisk",
|
|
|
|
"osType": "Linux",
|
|
|
|
"vhd": {
|
|
|
|
"uri": "[concat(parameters('storageAccountBlobEndpoint'),variables('vmStorageAccountContainerName'),'/', parameters('osDiskName'),'.vhd')]"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"type": "Microsoft.Compute/virtualMachines"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"variables": {
|
|
|
|
"addressPrefix": "10.0.0.0/16",
|
2017-05-29 00:06:09 -04:00
|
|
|
"apiVersion": "2017-03-30",
|
2016-07-11 17:36:49 -04:00
|
|
|
"location": "[resourceGroup().location]",
|
2017-05-29 00:06:09 -04:00
|
|
|
"managedDiskApiVersion": "2017-03-30",
|
|
|
|
"networkInterfacesApiVersion": "2017-04-01",
|
|
|
|
"publicIPAddressApiVersion": "2017-04-01",
|
2016-07-11 17:36:49 -04:00
|
|
|
"publicIPAddressType": "Dynamic",
|
|
|
|
"sshKeyPath": "[concat('/home/',parameters('adminUsername'),'/.ssh/authorized_keys')]",
|
|
|
|
"subnetAddressPrefix": "10.0.0.0/24",
|
2018-03-10 14:17:43 -05:00
|
|
|
"subnetName": "[parameters('subnetName')]",
|
2016-07-11 17:36:49 -04:00
|
|
|
"subnetRef": "[concat(variables('vnetID'),'/subnets/',variables('subnetName'))]",
|
2018-03-10 14:17:43 -05:00
|
|
|
"virtualNetworkName": "[parameters('virtualNetworkName')]",
|
|
|
|
"virtualNetworkResourceGroup": "[resourceGroup().name]",
|
2017-05-29 00:06:09 -04:00
|
|
|
"virtualNetworksApiVersion": "2017-04-01",
|
2018-03-10 14:17:43 -05:00
|
|
|
"vmStorageAccountContainerName": "images",
|
|
|
|
"vnetID": "[resourceId(variables('virtualNetworkResourceGroup'), 'Microsoft.Network/virtualNetworks', variables('virtualNetworkName'))]"
|
|
|
|
}
|
2016-05-21 02:01:16 -04:00
|
|
|
}
|