HTTP/1.1: Status Code Definitions


Custom BizTalk Functoid item template for Visual Studio 2015 is now available

Time to update and improve a very old project of mine: Item Template for Visual Studio 2010: Custom BizTalk Functoid. I really like this one because I normally create a lot of custom functoids and this will help me streamline my work. Be fast, more productive and avoid repeating and annoying task… that is my […]

via Custom BizTalk Functoid item template for Visual Studio 2015 is now available — Sandro Pereira BizTalk Blog

Azure Dev/Test Labs for your next team environment?



This article will run you through the features of the new free preview offering from Microsoft called Azure DevTest Labs.


Azure DevTest Labs gives developers on-demand, self-service, Azure-based test environments. Developers and testers can quickly create environments and resources in Azure while minimizing waste and controlling cost.

Also, create pre-provisioned environments for training and demonstrations.
Azure Resource Manager allows you to script the deployment of the whole environment which means it could be kicked off from your CI pipeline. Reusable templates can be the basis of your VMs (they can be either out of the box or created from your own VMs). Further customisation can be achieved through either, what’s called, artefacts or Configuration Management tools that kick in after provisioning a base VM. Examples of these tools would be Puppet, Chef or Desired State Configuration (DSC).

I’ve split this topic into two parts, the next article will go into detail on how to configure your machines using DSC & Chocolatey. But first let’s take a look around Dev/Test labs and how to script the creation of resources.




What does DevTest Labs have to offer


So if we go to the Azure Portal and select new resource, then search for DevTest we’ll see the offering to select and create. We’re then presented with this blade where we get to enter a name for the lab, choose a location, storage type and if we’d like the lab to be automatically shut down out of hours (a great way to save a heap of money).




Once created, if you open the new lab and select the “All Settings” link, you’ll be presented with a properties blade to allow you to configure the lab (not all options are implemented at the time of writing this article). Lets go through each section…




Audit Logs

Full audit of any actions carried out by the users of the lab such as creating VMs or deleting resources.



This option allows you to get to each of the VMs in the lab and manage these in the normal way you would any VM outside of DevTest labs, such as start/stop, connect or resize.


Artefact Repository

This is where you add new, or manage current, repositories of artefacts. Artefact repositories, such as the GitHub repository that comes as standard, contain a list of tools and extensions that can be installed on the VMs after they have been provisioned such as Powershell, DSC or Chocolatey. We’ll talk more about this later as we create an environment and then I’ll show you some alternative ways to configure your machines.


VM Bases

Again this is an interesting area of the offering. Here you can set up templates which can be selected by the team to allow them to quickly provision a new machine. DevTest Labs comes with a number of base VMs templates to choose from such as Windows Server, Windows Server with Visual Studio installed or a Linux distribution. It is also possible to create a new template based on an image you already have in Azure (perhaps you created a VM from a gallery image and then customised it somehow). Also you can create a template straight from a Azure gallery VM by going into the Azure Marketplace option and selecting “Yes” I would like to use the whole gallery as templates.

We’ll go into this in a bit more detail later and I’ll show you how to easily create the template variations using Azure Resource Manager templates.



Ok so I haven’t shown you much yet that distinguishes this offering from just creating a network of VMs in Azure (except having a nice set of templates to choose from). Policies is what they have added that really helps in a team environment. Devs love to go wild and spin up all sorts of resources Smile. In Azure it is easy to do this without giving a great deal of thought to the cost.


With policies we are able to add some control around

  • Expenditure per month
  • Number of VMs per user
  • Size of the VMs
  • Total VMs
  • Auto shut down/start up



And finally you are able to control which users can access the the Lab and the level of control they have (roles).




Let’s create an environment


Enough talking lets create a lab!


I’m going to walk you through creating a lab containing two VMs (of course it is possible to include PaaS resources as well as IaaS) –

  1. a BizTalk VM (inc. VS 2013 ). This will be created from an Azure gallery image, then (just for the sake of the demonstration) I will customise it with notepad++, then I’ll make that VM into a custom template for other members of the team to select.
  2. a Development VM based on the standard VS 2015 template that comes with DevTest Labs


If you select the resource group the lab lives in you’ll see we already have storage accounts created for us and a network for the VMs to communicate through (which is pretty awesome)





Next click on the Add VMs button you’ll see this blade and you’ll be able to add the development VM by choosing the VS2015 template from the Base option. Any user with permissions to the lab will be able to perform this option, templates makes creating a VM a self service function any user can perform.
What’s interesting about the VM size option is that only the sizes allowed by the policies will be shown so users can’t go mad and provision whatever they fancy.






So artefacts are software that you can have automatically installed on your VM after it’s provisioned. Also you might not want to install software but instead drop your latest build from your CI pipeline and deploy that, maybe you’ve stood this VM up just to test your build on.

In order to follow the next article on DSC you might want to select Powershell to be installed. It’s possible to install artefacts at any stage, just right click on a DevTest VM and select an artefact to be installed.

It’s possible to create your own artefacts this article explains how.




Finally choose your resource location and then you can preview the ARM template Azure will use to deploy your resource when you click Create. We’ll keep that template to one side as later on we’ll put all the templates together and make one uber template that can spin up the whole environment.


So we’ve created a VM from a standard template (we could also have selected an image from the Azure gallery). Next lets pretend we’ve customised that VM with some configured software. What we’d like to do then is to convert that VM into a template for others to use

To do this I refer you to the Azure Resource Manager GitHub repository where you will find a number of deployment files such as this one which will take a VM and convert it into a template


The big “Deploy to Azure” button sadly doesn’t work as the file has moved branches. It’s probably just as easy to copy the template text and then start your own ARM template deployment in the Azure portal.

To do that click here.

Then in the blade click the “Edit Template” option, paste the ARM template from GitHub into that blade and save.

Choose your subscription and resource group (the one you have your lab in) and agree to the legal terms. The final part is to populate the parameters




The existing lab name is the name you gave to your lab.

The template name is what you’d like this template to be named when others see it in the list of templates to select, and if that isn’t meaningful enough give the template a description too.

Finding the existing VM resource Id is a bit harder. The way I found it was through the website and searched by VM name. It will be something like

“/subscriptions/{subscription id}/resourceGroups/{resource group name}/providers/Microsoft.Compute/virtualMachines/{name of vm to template}”.

Clicking create should then create the template in your lab and be available to pick when you choose the base template for your new lab VMs.


Putting it all together


So far I’ve shown you how to create labs, templates and VMs through the portal UI but as we’ve seen along the way it’s all driven by ARM templates. It’s of course possible to combine all the templates into one template and create your environment in one step.

If you check my Gist then you’ll see the sort of script you’ll need.

If you run this json file using the custom deployment method mentioned before then (fingers crossed) and environment will be created for you automagically




So we’ve talked about the DevTest Labs offering and how it can help your development team by providing  a consistent way to spin up new environments per project.

With scripting it also becomes possible to incorporate labs into your CI pipeline.


Next time we’ll talk about customisation of your VMs and using DSC/Chocolatley as an alternative to artefacts





Search for quick start Azure Resource Manager templates. Dev/test specific templates can be found using the search term of dtl
Create a new lab in Azure DevTest Labs
Create a new VM template in Azure DevTest Labs
Create a new VM template in Azure DevTest Labs from an existing DevTest Lab / DTL VM
Create a new VM template in Azure DevTest Labs from an existing azure marketplace image
Easily install software and stay up to date via Chocolatley
My DSC Dev machine Gist


Technorati Tags: azure,dtl,dsc