github.phpd.cn/hashicorp/packer@v1.3.2/builder/azure/common/template/TestBuildLinux02.approved.txt (about) 1 { 2 "$schema": "http://schema.management.azure.com/schemas/2014-04-01-preview/deploymentTemplate.json", 3 "contentVersion": "1.0.0.0", 4 "parameters": { 5 "adminPassword": { 6 "type": "string" 7 }, 8 "adminUsername": { 9 "type": "string" 10 }, 11 "dnsNameForPublicIP": { 12 "type": "string" 13 }, 14 "osDiskName": { 15 "type": "string" 16 }, 17 "storageAccountBlobEndpoint": { 18 "type": "string" 19 }, 20 "vmName": { 21 "type": "string" 22 }, 23 "vmSize": { 24 "type": "string" 25 } 26 }, 27 "variables": { 28 "addressPrefix": "10.0.0.0/16", 29 "apiVersion": "2015-06-15", 30 "location": "[resourceGroup().location]", 31 "nicName": "packerNic", 32 "publicIPAddressName": "packerPublicIP", 33 "publicIPAddressType": "Dynamic", 34 "sshKeyPath": "[concat('/home/',parameters('adminUsername'),'/.ssh/authorized_keys')]", 35 "subnetAddressPrefix": "10.0.0.0/24", 36 "subnetName": "--subnet-name--", 37 "subnetRef": "[concat(variables('vnetID'),'/subnets/',variables('subnetName'))]", 38 "virtualNetworkName": "--virtual-network--", 39 "virtualNetworkResourceGroup": "--virtual-network-resource-group--", 40 "vmStorageAccountContainerName": "images", 41 "vnetID": "[resourceId(variables('virtualNetworkResourceGroup'), 'Microsoft.Network/virtualNetworks', variables('virtualNetworkName'))]" 42 }, 43 "resources": [ 44 { 45 "apiVersion": "[variables('apiVersion')]", 46 "name": "[variables('nicName')]", 47 "type": "Microsoft.Network/networkInterfaces", 48 "location": "[variables('location')]", 49 "dependsOn": [], 50 "properties": { 51 "ipConfigurations": [ 52 { 53 "properties": { 54 "privateIPAllocationMethod": "Dynamic", 55 "subnet": { 56 "id": "[variables('subnetRef')]" 57 } 58 }, 59 "name": "ipconfig" 60 } 61 ] 62 } 63 }, 64 { 65 "apiVersion": "[variables('apiVersion')]", 66 "name": "[parameters('vmName')]", 67 "type": "Microsoft.Compute/virtualMachines", 68 "location": "[variables('location')]", 69 "dependsOn": [ 70 "[concat('Microsoft.Network/networkInterfaces/', variables('nicName'))]" 71 ], 72 "properties": { 73 "diagnosticsProfile": { 74 "bootDiagnostics": { 75 "enabled": false 76 } 77 }, 78 "hardwareProfile": { 79 "vmSize": "[parameters('vmSize')]" 80 }, 81 "networkProfile": { 82 "networkInterfaces": [ 83 { 84 "id": "[resourceId('Microsoft.Network/networkInterfaces', variables('nicName'))]" 85 } 86 ] 87 }, 88 "osProfile": { 89 "computerName": "[parameters('vmName')]", 90 "adminUsername": "[parameters('adminUsername')]", 91 "adminPassword": "[parameters('adminPassword')]", 92 "linuxConfiguration": { 93 "ssh": { 94 "publicKeys": [ 95 { 96 "path": "[variables('sshKeyPath')]", 97 "keyData": "--test-ssh-authorized-key--" 98 } 99 ] 100 } 101 } 102 }, 103 "storageProfile": { 104 "osDisk": { 105 "osType": "Linux", 106 "name": "[parameters('osDiskName')]", 107 "vhd": { 108 "uri": "[concat(parameters('storageAccountBlobEndpoint'),variables('vmStorageAccountContainerName'),'/', parameters('osDiskName'),'.vhd')]" 109 }, 110 "image": { 111 "uri": "http://azure/custom.vhd" 112 }, 113 "caching": "ReadWrite", 114 "createOption": "FromImage" 115 } 116 } 117 } 118 } 119 ] 120 }