github.phpd.cn/hashicorp/packer@v1.3.2/builder/azure/common/template/template_builder_test.TestBuildWindows02.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('virtualNetworksApiVersion')]", 54 "location": "[variables('location')]", 55 "name": "[variables('virtualNetworkName')]", 56 "properties": { 57 "addressSpace": { 58 "addressPrefixes": [ 59 "[variables('addressPrefix')]" 60 ] 61 }, 62 "subnets": [ 63 { 64 "name": "[variables('subnetName')]", 65 "properties": { 66 "addressPrefix": "[variables('subnetAddressPrefix')]" 67 } 68 } 69 ] 70 }, 71 "type": "Microsoft.Network/virtualNetworks" 72 }, 73 { 74 "apiVersion": "[variables('networkInterfacesApiVersion')]", 75 "dependsOn": [ 76 "[concat('Microsoft.Network/publicIPAddresses/', parameters('publicIPAddressName'))]", 77 "[concat('Microsoft.Network/virtualNetworks/', variables('virtualNetworkName'))]" 78 ], 79 "location": "[variables('location')]", 80 "name": "[parameters('nicName')]", 81 "properties": { 82 "ipConfigurations": [ 83 { 84 "name": "ipconfig", 85 "properties": { 86 "privateIPAllocationMethod": "Dynamic", 87 "publicIPAddress": { 88 "id": "[resourceId('Microsoft.Network/publicIPAddresses', parameters('publicIPAddressName'))]" 89 }, 90 "subnet": { 91 "id": "[variables('subnetRef')]" 92 } 93 } 94 } 95 ] 96 }, 97 "type": "Microsoft.Network/networkInterfaces" 98 }, 99 { 100 "apiVersion": "[variables('apiVersion')]", 101 "dependsOn": [ 102 "[concat('Microsoft.Network/networkInterfaces/', parameters('nicName'))]" 103 ], 104 "location": "[variables('location')]", 105 "name": "[parameters('vmName')]", 106 "properties": { 107 "diagnosticsProfile": { 108 "bootDiagnostics": { 109 "enabled": false 110 } 111 }, 112 "hardwareProfile": { 113 "vmSize": "[parameters('vmSize')]" 114 }, 115 "networkProfile": { 116 "networkInterfaces": [ 117 { 118 "id": "[resourceId('Microsoft.Network/networkInterfaces', parameters('nicName'))]" 119 } 120 ] 121 }, 122 "osProfile": { 123 "adminPassword": "[parameters('adminPassword')]", 124 "adminUsername": "[parameters('adminUsername')]", 125 "computerName": "[parameters('vmName')]", 126 "secrets": [ 127 { 128 "sourceVault": { 129 "id": "[resourceId(resourceGroup().name, 'Microsoft.KeyVault/vaults', '--test-key-vault-name')]" 130 }, 131 "vaultCertificates": [ 132 { 133 "certificateStore": "My", 134 "certificateUrl": "--test-winrm-certificate-url--" 135 } 136 ] 137 } 138 ], 139 "windowsConfiguration": { 140 "provisionVMAgent": true, 141 "winRM": { 142 "listeners": [ 143 { 144 "certificateUrl": "--test-winrm-certificate-url--", 145 "protocol": "https" 146 } 147 ] 148 } 149 } 150 }, 151 "storageProfile": { 152 "dataDisks": [ 153 { 154 "caching": "ReadWrite", 155 "createOption": "Empty", 156 "diskSizeGB": 32, 157 "lun": 0, 158 "name": "datadisk-1", 159 "vhd": { 160 "uri": "[concat(parameters('storageAccountBlobEndpoint'),variables('vmStorageAccountContainerName'),'/datadisk-', '1','.vhd')]" 161 } 162 }, 163 { 164 "caching": "ReadWrite", 165 "createOption": "Empty", 166 "diskSizeGB": 64, 167 "lun": 1, 168 "name": "datadisk-2", 169 "vhd": { 170 "uri": "[concat(parameters('storageAccountBlobEndpoint'),variables('vmStorageAccountContainerName'),'/datadisk-', '2','.vhd')]" 171 } 172 } 173 ], 174 "osDisk": { 175 "caching": "ReadWrite", 176 "createOption": "FromImage", 177 "name": "[parameters('osDiskName')]", 178 "vhd": { 179 "uri": "[concat(parameters('storageAccountBlobEndpoint'),variables('vmStorageAccountContainerName'),'/', parameters('osDiskName'),'.vhd')]" 180 } 181 } 182 } 183 }, 184 "type": "Microsoft.Compute/virtualMachines" 185 } 186 ], 187 "variables": { 188 "addressPrefix": "10.0.0.0/16", 189 "apiVersion": "2017-03-30", 190 "location": "[resourceGroup().location]", 191 "managedDiskApiVersion": "2017-03-30", 192 "networkInterfacesApiVersion": "2017-04-01", 193 "publicIPAddressApiVersion": "2017-04-01", 194 "publicIPAddressType": "Dynamic", 195 "sshKeyPath": "[concat('/home/',parameters('adminUsername'),'/.ssh/authorized_keys')]", 196 "subnetAddressPrefix": "10.0.0.0/24", 197 "subnetName": "[parameters('subnetName')]", 198 "subnetRef": "[concat(variables('vnetID'),'/subnets/',variables('subnetName'))]", 199 "virtualNetworkName": "[parameters('virtualNetworkName')]", 200 "virtualNetworkResourceGroup": "[resourceGroup().name]", 201 "virtualNetworksApiVersion": "2017-04-01", 202 "vmStorageAccountContainerName": "images", 203 "vnetID": "[resourceId(variables('virtualNetworkResourceGroup'), 'Microsoft.Network/virtualNetworks', variables('virtualNetworkName'))]" 204 } 205 }