Azure Image Builder: a closer look

At Microsoft Build 2019 I attended a short session about Azure Image Builder & Azure Stack by Daniel Sol and Ihcene Cheriet. They showed a demo of a fully automated customized linux distro and add it as an image to the Azure tenant. Pretty awesome I thought. It took me a while, but this week I found some time to play with it.

What is Azure Image Builder?

Azure Image Builder (AIB) makes it possible to automate VM image creation for use in the Azure cloud. The image you create can be automatically placed in the Azure Shared Image Gallery, a managed image or as a VHD-file. The service is based HashiCorp Packer, so if you are familiar with Packer, you will quickly understand how it works. Azure Image Builder is still in Public Preview.

More information and technical details at docs.microsoft.com.

Image from: https://docs.microsoft.com/en-us/azure/virtual-machines/linux/image-builder-overview

So why use Azure Image Builder?

You can run some post-scripts on an out-of-the-box OS installation but often this is not enough, or it is too time-consuming in a deployment process. Customized images are still a big thing in all kinds of situations. Think for example CI/CD pipeline type of applications, regulatory requirements, you name it.

When it comes to Azure Stack you can think of disconnected scenarios or connected Stacks in the field. With this tool you’ll be able to create “golden images” in a consistent and effective manner and distribute them to your Azure Stacks wherever they are.

When the Ops guy tries to Dev…

One of the reasons I went to Build was to give my personal goal “be more Dev” a boost. I believe this test fitted right in. I followed the instructions to create a custom Ubuntu image and changed the output from an Image Gallery item to a VHD. I used probably more time then more experienced people, and I maybe sent one or to e-mails too many to Daniel, but hey, that’s how you learn! Overall it was a good experience and the documentation helped a lot.

Importing the VHD to Azure Stack

After I created the VHD-file I downloaded it from Public Azure and uploaded it to Azure Stack. I used AzureCLI to do this. Especially uploading large files is a problem with most browsers, so AzureCLI or AzCopy are great alternatives. (True hybrid cloud!)

I created an Image from the portal and deployed a VM from it. Worked like a charm! If you want, you can make an Azure Stack Marketplace item from it as well.

Ubuntu Linux with customized shell login

I recommend checking out Azure Image Builder if you are looking for a fully automated way to build custom images for Azure and/or Azure Stack. It is still in Public Preview so the developers will appreciate the feedback you can give them.

More resources:

MS Ignite 2018 session – https://www.youtube.com/watch?v=3ltzu0oa0Pk
MS Build 2019 session – https://mybuild.techcommunity.microsoft.com/sessions/77331

Let me know what you think: @BasWas

Spread the word. Share this post!