Skip to content

Instantly share code, notes, and snippets.

@mrled mrled/cloudbuilder.json
Last active Aug 31, 2017

Embed
What would you like to do?
wintriallab cloudbuilder template #bugreport
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"storageAccountName": {
"type": "string",
"metadata": {
"description": "Storage Account Name; must be a valid Azure DNS hostname"
}
},
"builderVmAdminPassword": {
"type": "securestring"
},
"builderVmSize": {
"type": "string",
"defaultValue": "Standard_D2_v3",
"metadata": {
"description": "Size of the VM. Note that only Standard Dv3 and Ev3 VMs support the nested virtualization we use."
}
}
},
"variables": {
"apiVersion": "2015-06-15",
"storageAccountType": "Standard_LRS",
"storageAccountId": "[concat('Microsoft.Storage/storageAccounts/', parameters('storageAccountName'))]",
"storageAccountUri": "[concat('http://',parameters('storageAccountName'), '.blob.core.windows.net')]",
"builderVmName": "wintrialbuilder",
"builderVmImageSku": "2016-Datacenter",
"builderVmOsDiskName": "[concat(variables('builderVmName'), '-osdisk')]",
"builderVmOsDiskUri": "[concat(variables('storageAccountUri'), '/vhds/', variables('builderVmOsDiskName'), '.vhd')]",
"builderVmAdminUsername": "WinTrialAdmin",
"winTrialLabDlPath": "${env:SystemDrive}\\winTrialLab.zip",
"winTrialLabRepoBaseUri": "https://github.com/mrled/wintriallab",
"winTrialLabRepoBranch": "azure-builder",
"winTrialLabZipUri": "[concat(variables('winTrialLabRepoBaseUri'), '/archive/', variables('winTrialLabRepoBranch'), '.zip')]",
"winTrialLabParentDir": "${env:SystemDrive}\\",
"winTrialLabDir": "[concat(variables('winTrialLabParentDir'), '\\wintriallab-', variables('winTrialLabRepoBranch'))]",
"deployExtName": "wtlDeployExtension",
"deployExtDownloadCmd": "[concat('Invoke-WebRequest -Uri ', variables('winTrialLabZipUri'), ' -OutFile ', variables('winTrialLabDlPath'), ';')]",
"deployExtUnpackCmd": "[concat('Expand-Archive -Force -DestinationPath ', variables('winTrialLabParentDir'), ' -Path ', variables('winTrialLabDlPath'), ';')]",
"deployExtInitCmd": "[concat('& ', variables('winTrialLabDir'), '\\azure\\deployInit.ps1', ';')]",
"deployExtCommand": "[concat(variables('deployExtDownloadCmd'), variables('deployExtUnpackCmd'), variables('deployExtInitCmd'))]",
"deployExtInvocation": "[concat('powershell.exe -NoProfile -ExecutionPolicy Unrestricted -Command \"& {', variables('deployExtCommand'), '} \"')]",
"vnetName": "wintrialnet",
"vnetId": "[resourceId('Microsoft.Network/virtualNetworks', variables('vnetName'))]",
"vnetAddressPrefix": "172.16.0.0/24",
"subnetName": "wintrialsubnet",
"subnetPrefix": "[variables('vnetAddressPrefix')]",
"subnetId": "[concat(variables('vnetId'), '/subnets/', variables('subnetName'))]",
"pubIpAddrType": "Dynamic",
"pubIpAddrName": "builderPubIp",
"pubIpAddrId": "[resourceId('Microsoft.Network/publicIPAddresses', variables('pubIpAddrName'))]",
"nicName": "builderNic",
"nicId": "[resourceId('Microsoft.Network/networkInterfaces', variables('nicName'))]",
"imagePublisher": "MicrosoftWindowsServer",
"imageOffer": "WindowsServer"
},
"resources": [
{
"type": "Microsoft.Storage/storageAccounts",
"name": "[parameters('storageAccountName')]",
"apiVersion": "[variables('apiVersion')]",
"location": "[resourceGroup().location]",
"properties": {
"accountType": "[variables('storageAccountType')]"
}
},
{
"type": "Microsoft.Network/publicIPAddresses",
"name": "[variables('pubIpAddrName')]",
"apiVersion": "[variables('apiVersion')]",
"location": "[resourceGroup().location]",
"properties": {
"publicIPAllocationMethod": "[variables('pubIpAddrType')]"
}
},
{
"type": "Microsoft.Network/virtualNetworks",
"name": "[variables('vnetName')]",
"apiVersion": "[variables('apiVersion')]",
"location": "[resourceGroup().location]",
"properties": {
"addressSpace": {
"addressPrefixes": [
"[variables('vnetAddressPrefix')]"
]
},
"subnets": [
{
"name": "[variables('subnetName')]",
"properties": {
"addressPrefix": "[variables('subnetPrefix')]"
}
}
]
}
},
{
"type": "Microsoft.Network/networkInterfaces",
"name": "[variables('nicName')]",
"apiVersion": "[variables('apiVersion')]",
"location": "[resourceGroup().location]",
"dependsOn": [
"[variables('pubIpAddrId')]",
"[variables('vnetId')]"
],
"properties": {
"ipConfigurations": [
{
"name": "ipconfig1",
"properties": {
"privateIPAllocationMethod": "Dynamic",
"publicIPAddress": {
"id": "[variables('pubIpAddrId')]"
},
"subnet": {
"id": "[variables('subnetId')]"
}
}
}
]
}
},
{
"type": "Microsoft.Compute/virtualMachines",
"name": "[variables('builderVmName')]",
"apiVersion": "[variables('apiVersion')]",
"location": "[resourceGroup().location]",
"dependsOn": [
"[variables('storageAccountId')]",
"[variables('nicId')]"
],
"properties": {
"hardwareProfile": {
"vmSize": "[parameters('builderVmSize')]"
},
"osProfile": {
"computerName": "[variables('builderVmName')]",
"adminUsername": "[variables('builderVmAdminUsername')]",
"adminPassword": "[parameters('builderVmAdminPassword')]"
},
"storageProfile": {
"imageReference": {
"publisher": "[variables('imagePublisher')]",
"offer": "[variables('imageOffer')]",
"sku": "[variables('builderVmImageSku')]",
"version": "latest"
},
"osDisk": {
"name": "[variables('builderVmOsDiskName')]",
"vhd": {
"uri": "[variables('builderVmOsDiskUri')]"
},
"caching": "ReadWrite",
"createOption": "FromImage"
}
},
"networkProfile": {
"networkInterfaces": [
{
"id": "[variables('nicId')]"
}
]
}
},
"resources": [
{
"type": "extensions",
"name": "[variables('deployExtName')]",
"apiVersion": "[variables('apiVersion')]",
"location": "[resourceGroup().location]",
"dependsOn": [
"[variables('builderVmName')]"
],
"properties": {
"publisher": "Microsoft.Compute",
"type": "CustomScriptExtension",
"typeHandlerVersion": "1.8",
"autoUpgradeMinorVersion": true,
"settings": {
"commandToExecute": "[variables('deployExtInvocation')]"
}
}
}
]
}
],
"outputs": {
"builderConnectionInformation": {
"type": "object",
"value": {
"Username": "[variables('builderVmAdminUsername')]",
"Password": "[parameters('builderVmAdminPassword')]",
"Public IP Address": "[reference(variables('pubIpAddrName')).ipAddress]"
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.