2018-02-23 18:34:13 -05: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"
|
|
|
|
},
|
2019-10-08 17:56:43 -04:00
|
|
|
"nsgName": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
2018-02-23 18:34:13 -05:00
|
|
|
"osDiskName": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
2018-03-10 14:17:43 -05:00
|
|
|
"publicIPAddressName": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
2018-02-23 18:34:13 -05:00
|
|
|
"storageAccountBlobEndpoint": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
2018-03-10 14:17:43 -05:00
|
|
|
"subnetName": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"virtualNetworkName": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
2018-02-23 18:34:13 -05:00
|
|
|
"vmName": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"vmSize": {
|
|
|
|
"type": "string"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"resources": [
|
|
|
|
{
|
|
|
|
"apiVersion": "[variables('publicIPAddressApiVersion')]",
|
|
|
|
"location": "[variables('location')]",
|
2018-03-10 14:17:43 -05:00
|
|
|
"name": "[parameters('publicIPAddressName')]",
|
2018-02-23 18:34:13 -05:00
|
|
|
"properties": {
|
|
|
|
"dnsSettings": {
|
|
|
|
"domainNameLabel": "[parameters('dnsNameForPublicIP')]"
|
|
|
|
},
|
|
|
|
"publicIPAllocationMethod": "[variables('publicIPAddressType')]"
|
|
|
|
},
|
|
|
|
"type": "Microsoft.Network/publicIPAddresses"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"apiVersion": "[variables('virtualNetworksApiVersion')]",
|
|
|
|
"location": "[variables('location')]",
|
|
|
|
"name": "[variables('virtualNetworkName')]",
|
|
|
|
"properties": {
|
|
|
|
"addressSpace": {
|
|
|
|
"addressPrefixes": [
|
|
|
|
"[variables('addressPrefix')]"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"subnets": [
|
|
|
|
{
|
|
|
|
"name": "[variables('subnetName')]",
|
|
|
|
"properties": {
|
|
|
|
"addressPrefix": "[variables('subnetAddressPrefix')]"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"type": "Microsoft.Network/virtualNetworks"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"apiVersion": "[variables('networkInterfacesApiVersion')]",
|
|
|
|
"dependsOn": [
|
2018-03-10 14:17:43 -05:00
|
|
|
"[concat('Microsoft.Network/publicIPAddresses/', parameters('publicIPAddressName'))]",
|
2018-02-23 18:34:13 -05:00
|
|
|
"[concat('Microsoft.Network/virtualNetworks/', variables('virtualNetworkName'))]"
|
|
|
|
],
|
|
|
|
"location": "[variables('location')]",
|
2018-03-10 14:17:43 -05:00
|
|
|
"name": "[parameters('nicName')]",
|
2018-02-23 18:34:13 -05:00
|
|
|
"properties": {
|
|
|
|
"ipConfigurations": [
|
|
|
|
{
|
|
|
|
"name": "ipconfig",
|
|
|
|
"properties": {
|
|
|
|
"privateIPAllocationMethod": "Dynamic",
|
|
|
|
"publicIPAddress": {
|
2018-03-10 14:17:43 -05:00
|
|
|
"id": "[resourceId('Microsoft.Network/publicIPAddresses', parameters('publicIPAddressName'))]"
|
2018-02-23 18:34:13 -05: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'))]"
|
2018-02-23 18:34:13 -05: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'))]"
|
2018-02-23 18:34:13 -05:00
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"osProfile": {
|
|
|
|
"adminPassword": "[parameters('adminPassword')]",
|
|
|
|
"adminUsername": "[parameters('adminUsername')]",
|
|
|
|
"computerName": "[parameters('vmName')]",
|
|
|
|
"secrets": [
|
|
|
|
{
|
|
|
|
"sourceVault": {
|
|
|
|
"id": "[resourceId(resourceGroup().name, 'Microsoft.KeyVault/vaults', '--test-key-vault-name')]"
|
|
|
|
},
|
|
|
|
"vaultCertificates": [
|
|
|
|
{
|
|
|
|
"certificateStore": "My",
|
|
|
|
"certificateUrl": "--test-winrm-certificate-url--"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"windowsConfiguration": {
|
|
|
|
"provisionVMAgent": true,
|
|
|
|
"winRM": {
|
|
|
|
"listeners": [
|
|
|
|
{
|
|
|
|
"certificateUrl": "--test-winrm-certificate-url--",
|
|
|
|
"protocol": "https"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"storageProfile": {
|
|
|
|
"dataDisks": [
|
|
|
|
{
|
|
|
|
"caching": "ReadWrite",
|
|
|
|
"createOption": "Empty",
|
|
|
|
"diskSizeGB": 32,
|
|
|
|
"lun": 0,
|
|
|
|
"name": "datadisk-1",
|
|
|
|
"vhd": {
|
|
|
|
"uri": "[concat(parameters('storageAccountBlobEndpoint'),variables('vmStorageAccountContainerName'),'/datadisk-', '1','.vhd')]"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"caching": "ReadWrite",
|
|
|
|
"createOption": "Empty",
|
|
|
|
"diskSizeGB": 64,
|
|
|
|
"lun": 1,
|
|
|
|
"name": "datadisk-2",
|
|
|
|
"vhd": {
|
|
|
|
"uri": "[concat(parameters('storageAccountBlobEndpoint'),variables('vmStorageAccountContainerName'),'/datadisk-', '2','.vhd')]"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"osDisk": {
|
|
|
|
"caching": "ReadWrite",
|
|
|
|
"createOption": "FromImage",
|
2018-05-02 14:18:03 -04:00
|
|
|
"name": "[parameters('osDiskName')]",
|
2018-02-23 18:34:13 -05:00
|
|
|
"vhd": {
|
|
|
|
"uri": "[concat(parameters('storageAccountBlobEndpoint'),variables('vmStorageAccountContainerName'),'/', parameters('osDiskName'),'.vhd')]"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"type": "Microsoft.Compute/virtualMachines"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"variables": {
|
|
|
|
"addressPrefix": "10.0.0.0/16",
|
|
|
|
"apiVersion": "2017-03-30",
|
|
|
|
"location": "[resourceGroup().location]",
|
|
|
|
"managedDiskApiVersion": "2017-03-30",
|
|
|
|
"networkInterfacesApiVersion": "2017-04-01",
|
2019-10-08 17:56:43 -04:00
|
|
|
"networkSecurityGroupsApiVersion": "2019-04-01",
|
2018-02-23 18:34:13 -05:00
|
|
|
"publicIPAddressApiVersion": "2017-04-01",
|
|
|
|
"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')]",
|
2018-02-23 18:34:13 -05:00
|
|
|
"subnetRef": "[concat(variables('vnetID'),'/subnets/',variables('subnetName'))]",
|
2018-03-10 14:17:43 -05:00
|
|
|
"virtualNetworkName": "[parameters('virtualNetworkName')]",
|
2018-02-23 18:34:13 -05:00
|
|
|
"virtualNetworkResourceGroup": "[resourceGroup().name]",
|
|
|
|
"virtualNetworksApiVersion": "2017-04-01",
|
|
|
|
"vmStorageAccountContainerName": "images",
|
|
|
|
"vnetID": "[resourceId(variables('virtualNetworkResourceGroup'), 'Microsoft.Network/virtualNetworks', variables('virtualNetworkName'))]"
|
|
|
|
}
|
|
|
|
}
|