github.com/rahart/packer@v0.12.2-0.20161229105310-282bb6ad370f/builder/azure/common/template/template_builder_test.TestBuildWindows00.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 "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 "resources": [ 28 { 29 "apiVersion": "[variables('apiVersion')]", 30 "location": "[variables('location')]", 31 "name": "[variables('publicIPAddressName')]", 32 "properties": { 33 "dnsSettings": { 34 "domainNameLabel": "[parameters('dnsNameForPublicIP')]" 35 }, 36 "publicIPAllocationMethod": "[variables('publicIPAddressType')]" 37 }, 38 "type": "Microsoft.Network/publicIPAddresses" 39 }, 40 { 41 "apiVersion": "[variables('apiVersion')]", 42 "location": "[variables('location')]", 43 "name": "[variables('virtualNetworkName')]", 44 "properties": { 45 "addressSpace": { 46 "addressPrefixes": [ 47 "[variables('addressPrefix')]" 48 ] 49 }, 50 "subnets": [ 51 { 52 "name": "[variables('subnetName')]", 53 "properties": { 54 "addressPrefix": "[variables('subnetAddressPrefix')]" 55 } 56 } 57 ] 58 }, 59 "type": "Microsoft.Network/virtualNetworks" 60 }, 61 { 62 "apiVersion": "[variables('apiVersion')]", 63 "dependsOn": [ 64 "[concat('Microsoft.Network/publicIPAddresses/', variables('publicIPAddressName'))]", 65 "[concat('Microsoft.Network/virtualNetworks/', variables('virtualNetworkName'))]" 66 ], 67 "location": "[variables('location')]", 68 "name": "[variables('nicName')]", 69 "properties": { 70 "ipConfigurations": [ 71 { 72 "name": "ipconfig", 73 "properties": { 74 "privateIPAllocationMethod": "Dynamic", 75 "publicIPAddress": { 76 "id": "[resourceId('Microsoft.Network/publicIPAddresses', variables('publicIPAddressName'))]" 77 }, 78 "subnet": { 79 "id": "[variables('subnetRef')]" 80 } 81 } 82 } 83 ] 84 }, 85 "type": "Microsoft.Network/networkInterfaces" 86 }, 87 { 88 "apiVersion": "[variables('apiVersion')]", 89 "dependsOn": [ 90 "[concat('Microsoft.Network/networkInterfaces/', variables('nicName'))]" 91 ], 92 "location": "[variables('location')]", 93 "name": "[parameters('vmName')]", 94 "properties": { 95 "diagnosticsProfile": { 96 "bootDiagnostics": { 97 "enabled": false 98 } 99 }, 100 "hardwareProfile": { 101 "vmSize": "[parameters('vmSize')]" 102 }, 103 "networkProfile": { 104 "networkInterfaces": [ 105 { 106 "id": "[resourceId('Microsoft.Network/networkInterfaces', variables('nicName'))]" 107 } 108 ] 109 }, 110 "osProfile": { 111 "adminPassword": "[parameters('adminPassword')]", 112 "adminUsername": "[parameters('adminUsername')]", 113 "computerName": "[parameters('vmName')]", 114 "secrets": [ 115 { 116 "sourceVault": { 117 "id": "[resourceId(resourceGroup().name, 'Microsoft.KeyVault/vaults', '--test-key-vault-name')]" 118 }, 119 "vaultCertificates": [ 120 { 121 "certificateStore": "My", 122 "certificateUrl": "--test-winrm-certificate-url--" 123 } 124 ] 125 } 126 ], 127 "windowsConfiguration": { 128 "provisionVMAgent": true, 129 "winRM": { 130 "listeners": [ 131 { 132 "certificateUrl": "--test-winrm-certificate-url--", 133 "protocol": "https" 134 } 135 ] 136 } 137 } 138 }, 139 "storageProfile": { 140 "imageReference": { 141 "offer": "WindowsServer", 142 "publisher": "MicrosoftWindowsServer", 143 "sku": "2012-R2-Datacenter", 144 "version": "latest" 145 }, 146 "osDisk": { 147 "caching": "ReadWrite", 148 "createOption": "FromImage", 149 "name": "osdisk", 150 "vhd": { 151 "uri": "[concat(parameters('storageAccountBlobEndpoint'),variables('vmStorageAccountContainerName'),'/', parameters('osDiskName'),'.vhd')]" 152 } 153 } 154 } 155 }, 156 "type": "Microsoft.Compute/virtualMachines" 157 } 158 ], 159 "variables": { 160 "addressPrefix": "10.0.0.0/16", 161 "apiVersion": "2015-06-15", 162 "location": "[resourceGroup().location]", 163 "nicName": "packerNic", 164 "publicIPAddressName": "packerPublicIP", 165 "publicIPAddressType": "Dynamic", 166 "sshKeyPath": "[concat('/home/',parameters('adminUsername'),'/.ssh/authorized_keys')]", 167 "subnetAddressPrefix": "10.0.0.0/24", 168 "subnetName": "packerSubnet", 169 "subnetRef": "[concat(variables('vnetID'),'/subnets/',variables('subnetName'))]", 170 "virtualNetworkName": "packerNetwork", 171 "virtualNetworkResourceGroup": "[resourceGroup().name]", 172 "vmStorageAccountContainerName": "images", 173 "vnetID": "[resourceId(variables('virtualNetworkResourceGroup'), 'Microsoft.Network/virtualNetworks', variables('virtualNetworkName'))]" 174 } 175 }