Azure Journey–Azure Dev/Test Labs–Creating A VM With Artifacts

Dev/Test lab artifacts allow you to specify actions that are performed on the VM when it is created.  These actions can include things such as installing applications, running PowerShell scripts, and running Bash commands. You can also apply artifacts to a VM after it has been created.

So let’s create a VM and include artifacts in the creation.

Open the Azure portal (https://portal.azure.com) and open the lab I’ve been working with. Click the +Virtual Machine button to create a new VM. Select Windows Server 2016 technical preview 5 as the base image.

On the settings page for the new VM, click Artifacts to open the Add Artifacts blade.

image

I’ve selected a Windows OS, so I see a list of Windows artifacts.  The list will change based off the base image you select.  For example, if I change to a Linus OS, I see a different list of artifacts:

image

All the artifacts that you see are stored in a public Git repository and are shipped by Microsoft. You do have the ability to both create your own private repositories, as well as create your own custom artifacts, but I won’t be going into those in this post.

Let’s change the OS back to Windows Server 2016. I’m going to select Azure PowerShell and click Add.

image

I’m also going to select NotePad++ and click Add

image

At top of the Add Artifacts blade there is now a link, 2 artifacts selected. I can click this link to see the two I’ve selected., I can drag and drop them to reorder them.

Once I’ve finished configuring the VM and selecting artifacts, I can click Create on the Virtual Machine Configuration Settings blade to create the VM. It will create the VM and install the two selected artifacts.

 

image

In the above image I’ve pulled up the blade for the VM.  One thing I like is how I can easily tell this VM is part of a lab (I have lab options, such as adding artifacts, and I have the ability to opt in/out of auto-shutdown or restart.

If I connect to the VM using the RDP file (downloaded from the Connect button), I’ll see that Notepad++ and Azure PowerShell were installed for me.

I love this concept of artifacts. You get a lot of really powerful ones out of the box, plus the ability to create custom artifacts. This will really help with lab creation. Something else that will help with lab creation is Formulas, which I’ll cover in the next post.

  • Add Your Comment