github.phpd.cn/hashicorp/packer@v1.3.2/builder/azure/arm/template_factory_test.TestVirtualMachineDeployment10.approved.json (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 "nicName": { 15 "type": "string" 16 }, 17 "osDiskName": { 18 "type": "string" 19 }, 20 "publicIPAddressName": { 21 "type": "string" 22 }, 23 "storageAccountBlobEndpoint": { 24 "type": "string" 25 }, 26 "subnetName": { 27 "type": "string" 28 }, 29 "virtualNetworkName": { 30 "type": "string" 31 }, 32 "vmName": { 33 "type": "string" 34 }, 35 "vmSize": { 36 "type": "string" 37 } 38 }, 39 "resources": [ 40 { 41 "apiVersion": "[variables('publicIPAddressApiVersion')]", 42 "location": "[variables('location')]", 43 "name": "[parameters('publicIPAddressName')]", 44 "properties": { 45 "dnsSettings": { 46 "domainNameLabel": "[parameters('dnsNameForPublicIP')]" 47 }, 48 "publicIPAllocationMethod": "[variables('publicIPAddressType')]" 49 }, 50 "type": "Microsoft.Network/publicIPAddresses" 51 }, 52 { 53 "apiVersion": "[variables('networkInterfacesApiVersion')]", 54 "dependsOn": [ 55 "[concat('Microsoft.Network/publicIPAddresses/', parameters('publicIPAddressName'))]" 56 ], 57 "location": "[variables('location')]", 58 "name": "[parameters('nicName')]", 59 "properties": { 60 "ipConfigurations": [ 61 { 62 "name": "ipconfig", 63 "properties": { 64 "privateIPAllocationMethod": "Dynamic", 65 "publicIPAddress": { 66 "id": "[resourceId('Microsoft.Network/publicIPAddresses', parameters('publicIPAddressName'))]" 67 }, 68 "subnet": { 69 "id": "[variables('subnetRef')]" 70 } 71 } 72 } 73 ] 74 }, 75 "type": "Microsoft.Network/networkInterfaces" 76 }, 77 { 78 "apiVersion": "[variables('apiVersion')]", 79 "dependsOn": [ 80 "[concat('Microsoft.Network/networkInterfaces/', parameters('nicName'))]" 81 ], 82 "location": "[variables('location')]", 83 "name": "[parameters('vmName')]", 84 "properties": { 85 "diagnosticsProfile": { 86 "bootDiagnostics": { 87 "enabled": false 88 } 89 }, 90 "hardwareProfile": { 91 "vmSize": "[parameters('vmSize')]" 92 }, 93 "networkProfile": { 94 "networkInterfaces": [ 95 { 96 "id": "[resourceId('Microsoft.Network/networkInterfaces', parameters('nicName'))]" 97 } 98 ] 99 }, 100 "osProfile": { 101 "adminPassword": "[parameters('adminPassword')]", 102 "adminUsername": "[parameters('adminUsername')]", 103 "computerName": "[parameters('vmName')]", 104 "linuxConfiguration": { 105 "ssh": { 106 "publicKeys": [ 107 { 108 "keyData": "", 109 "path": "[variables('sshKeyPath')]" 110 } 111 ] 112 } 113 } 114 }, 115 "storageProfile": { 116 "imageReference": { 117 "offer": "--image-offer--", 118 "publisher": "--image-publisher--", 119 "sku": "--image-sku--", 120 "version": "--version--" 121 }, 122 "osDisk": { 123 "caching": "ReadWrite", 124 "createOption": "FromImage", 125 "managedDisk": { 126 "storageAccountType": "Standard_LRS" 127 }, 128 "name": "[parameters('osDiskName')]", 129 "osType": "Linux" 130 } 131 } 132 }, 133 "type": "Microsoft.Compute/virtualMachines" 134 } 135 ], 136 "variables": { 137 "addressPrefix": "10.0.0.0/16", 138 "apiVersion": "2017-03-30", 139 "location": "[resourceGroup().location]", 140 "managedDiskApiVersion": "2017-03-30", 141 "networkInterfacesApiVersion": "2017-04-01", 142 "publicIPAddressApiVersion": "2017-04-01", 143 "publicIPAddressType": "Dynamic", 144 "sshKeyPath": "[concat('/home/',parameters('adminUsername'),'/.ssh/authorized_keys')]", 145 "subnetAddressPrefix": "10.0.0.0/24", 146 "subnetName": "--virtual_network_subnet_name--", 147 "subnetRef": "[concat(variables('vnetID'),'/subnets/',variables('subnetName'))]", 148 "virtualNetworkName": "--virtual_network_name--", 149 "virtualNetworkResourceGroup": "--virtual_network_resource_group_name--", 150 "virtualNetworksApiVersion": "2017-04-01", 151 "vmStorageAccountContainerName": "images", 152 "vnetID": "[resourceId(variables('virtualNetworkResourceGroup'), 'Microsoft.Network/virtualNetworks', variables('virtualNetworkName'))]" 153 } 154 }