Skip to content

Instantly share code, notes, and snippets.

@PaulNichols
Last active February 15, 2021 09:39
Show Gist options
  • Save PaulNichols/11a879073f30797aeb6c to your computer and use it in GitHub Desktop.
Save PaulNichols/11a879073f30797aeb6c to your computer and use it in GitHub Desktop.
Deployment script to create a dev test lab environment
{
"$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"labName": {
"type": "string",
"metadata": {
"description": "The name of the new lab instance to be created"
}
},
"environmentName": {
"type": "string"
},
"devVmName": {
"type": "string"
},
"devVmuserName": {
"type": "string"
},
"devVmsize": {
"type": "string",
"defaultValue": "Standard_A0"
},
"devVmpassword": {
"type": "securestring"
}
},
"resources": [
{
"apiVersion": "2015-05-21-preview",
"type": "Microsoft.DevTestLab/labs",
"name": "[parameters('labName')]",
"location": "[resourceGroup().location]"
},
{
"apiVersion": "2015-05-21-preview",
"type": "Microsoft.DevTestLab/labs/environments",
"name": "[concat(parameters('labName'), '/', parameters('environmentName'))]",
"location": "centralus",
"properties": {
"labVirtualNetworkId": "[concat(resourceGroup().id, '/providers/Microsoft.DevTestLab/labs/', parameters('labName'), '/virtualnetworks/default')]",
"notes": "Visual Studio Enterprise 2015 with Azure SDK 2.8 on Windows Server 2012 R2",
"vms": [
{
"name": "[parameters('devVmName')]",
"galleryImageReference": {
"offer": "VisualStudio",
"publisher": "MicrosoftVisualStudio",
"sku": "VS-2015-Ent-AzureSDK-2.8-WS2012R2.2",
"osType": "Windows",
"version": "latest"
},
"size": "[parameters('devVmsize')]",
"userName": "[parameters('devVmuserName')]",
"password": "[parameters('devVmpassword')]",
"isAuthenticationWithSshKey": false,
"subnetId": "[concat(resourceGroup().id, '/providers/Microsoft.Network/virtualNetworks/Dtl',parameters('labName'),'vNet/subnets/Dtl',parameters('labName'),'Subnet')]",
"disallowPublicIpAddress": false
}
]
}
,
"dependsOn": [
"[resourceId('Microsoft.DevTestLab/labs', parameters('labName'))]"
]
}
],
"outputs": {
"labId": {
"type": "string",
"value": "[resourceId('Microsoft.DevTestLab/labs', parameters('labName'))]"
}
}
}
@djpirra
Copy link

djpirra commented Feb 15, 2021

How would you deploy if it was a PaaS environment template?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment