2026-08-10 · Season 3
Azure Image Builder - Simply Explained

Show notes
Azure Image Builder solves a problem that becomes increasingly difficult as environments grow: manually creating and maintaining standardized virtual machine images. The traditional process often starts with a clean VM. An administrator installs Windows updates, applications, monitoring agents, security tools, certificates, and configuration changes. The VM is tested, generalized, and finally captured as an image. That approach can work, but it depends heavily on people remembering every step. When updates or requirements change, the process has to be repeated, and small differences can quickly appear between supposedly identical images. Azure Image Builder replaces that manual routine with a repeatable Azure-based process. ㅤ WHAT IS AZURE IMAGE BUILDER? Azure Image Builder is an Azure service that creates customized virtual machine images from instructions you define. You begin with a known source image, define the changes that should be made, and Azure produces a new customized image. The result becomes a standardized starting point for future virtual machines rather than requiring administrators to configure every new VM manually. ㅤ START WITH A KNOWN SOURCE IMAGE Azure Image Builder can begin with Windows or Linux images from Azure Marketplace. That could include Windows Server, Windows 11, Ubuntu, or another supported operating system. Organizations can also start with images they have already created, including existing company images or images stored in Azure Compute Gallery. This means you don't necessarily need to rebuild everything from scratch whenever the image changes. ㅤ IMAGE BUILDER DOES NOT CREATE YOUR PRODUCTION VMS The name can create some confusion. Azure Image Builder isn't primarily responsible for creating the production VMs that users or applications eventually consume. It creates the prepared image first. Afterward, organizations can create one VM, ten VMs, or potentially much larger deployments from that finished image. Think of Image Builder as creating the approved master copy from which future machines are deployed. ㅤ PACKER BEHIND THE SCENES Azure Image Builder uses HashiCorp Packer behind the scenes. Packer is widely used for automating machine-image creation. Azure Image Builder provides an Azure-managed layer around that process, meaning organizations don't need to operate their own Packer infrastructure simply to automate Azure image builds. You define what the image should contain while Azure manages much of the temporary infrastructure required to create it. ㅤ WHY AUTOMATE VM IMAGES? Imagine that every Windows Server in your organization should begin with the same Windows updates, browser, monitoring agent, security software, certificates, and configuration baseline. With a manual process, administrators need to reproduce those requirements correctly every time. With Azure Image Builder, those requirements become part of the image-building instructions. When something changes, you update the instructions and produce another image version. This replaces administrator memory and manual checklists with a repeatable process. ㅤ THE FIVE BUILDING BLOCKS A useful way to understand Azure Image Builder is through five major components: Source. Customization. Validation. Distribution. Versioning. Together, these components describe where the image starts, what Azure changes, how the result is tested, where the finished image is published, and how different releases are managed. ㅤ SOURCE The source image provides the operating system and initial configuration. A web-server team might begin with Ubuntu. An application team could use Windows Server. An Azure Virtual Desktop environment might begin with Windows 11. The source should match the workload the future VMs are expected to run. ㅤ CUSTOMIZATION Customization defines what Azure Image Builder should change. Scripts can install applications, apply Windows updates, add language packs, install monitoring and security agents, configure certificates, remove unwanted software, or apply security settings. Azure Image Builder executes these customizations in the order you define. That order matters because applications and configuration changes can depend on earlier steps completing successfully. ㅤ KEEP CUSTOMIZATIONS SMALL One enormous customization script can become difficult to troubleshoot. Smaller scripts make the process easier to understand and maintain. One script might install the monitoring agent. Another could configure security settings. Another might verify that a required application exists. When something fails, administrators can identify the problematic stage instead of investigating hundreds of unrelated lines in one script. ㅤ VALIDATION A successful installation doesn't automatically mean the image works correctly. Validation allows organizations to check the finished configuration before publishing the image. You might verify that an application exists, confirm that an important service starts correctly, or check whether a security setting has the expected value. The objective is to discover problems during the image build rather than after dozens or hundreds of VMs have already been deployed. ㅤ DISTRIBUTION After an image passes validation, Azure Image Builder can publish the result. Possible destinations include Azure Compute Gallery, a managed image, or a VHD file. For organizations managing reusable Azure VM images at scale, Azure Compute Gallery provides additional capabilities for organizing, versioning, replicating, and distributing those images. ㅤ VERSIONING Each successful image build can create a new version. For example, an April image might contain one set of Windows updates and version 4.2 of a company agent. The May image could contain newer patches and version 4.3. Keeping these versions separate makes it possible to identify exactly which image produced a VM and provides a controlled way to return to an earlier known-good release if a newer image introduces problems. ㅤ THE IMAGE TEMPLATE The image template acts as the instruction sheet for the entire build. It defines the source image, customizations, build configuration, networking requirements, destination, and identity used during the process. Instead of manually repeating the preparation process, the template describes what Azure should do every time the image is rebuilt. ㅤ MANAGED IDENTITY Azure needs permission to interact with resources during the image build. A managed identity can provide those permissions without requiring usernames and passwords to be embedded inside scripts. The identity might need permission to read installation files, access storage, create temporary resources, use required networking, and publish the completed image. The principle of least privilege still applies: the build identity should receive only the permissions required to complete its job. ㅤ THE TEMPORARY BUILD VM When a build begins, Azure creates temporary resources. One of the most important is a temporary virtual machine. This isn't a production server. It's the temporary workshop where Azure installs software, runs updates, applies settings, and prepares the final image. Supporting disks, networking, and storage resources can also appear during the build process. ㅤ WHY TEMPORARY RESOURCES APPEAR Administrators may notice additional resources appearing in a staging resource group while Image Builder runs. This is expected. Azure needs actual compute and supporting infrastructure to execute the image-building process. The temporary VM allows Azure to customize a copy without modifying the original source image. ㅤ RUNNING THE CUSTOMIZATION SCRIPTS Azure executes customization scripts according to the order defined in the template. A typical build might install a browser, add a security agent, install operating system updates, remove unwanted applications, and apply company security settings. Dependencies need to be considered carefully. If an application requires a Windows update before installation, the update needs to happen first. If an installer requires a restart, later steps need to account for that restart. ㅤ EVERYTHING MUST BE AUTOMATIC Image-building scripts need to operate without human interaction. An installer that opens a dialog and waits for someone to click Next can stop the build. Applications should therefore support silent installation. Scripts should also wait for commands to complete and return meaningful success or failure codes. The temporary VM doesn't have an administrator sitting in front of it waiting to answer installation prompts. ㅤ BUILD ONCE, DEPLOY MANY TIMES Consider a monthly Windows Server image. Image Builder starts with the current Windows Server source, installs the latest approved Windows updates, updates the browser, installs the company's security agent, and applies standard configuration. Once that image is created, every VM deployed from it already contains those changes. Instead of 100 new VMs individually downloading and installing the same software and patches, the preparation occurs once during image creation. Become a supporter of this podcast: https://www.spreaker.com/podcast/m365-fm-microsoft-365-azure-cloud-power-platform-ai--6704921/support.
Apple Podcasts · Spotify · YouTube · Deezer
Host: Mirko Peters
Related articles
Transcript
Read the full transcript
So let's say your company needs a standard Windows server image. The old way usually starts with a fresh virtual machine. You install Windows updates. You add the apps people expect. You drop in a monitoring agent, tweak a few settings, apply security rules, test everything, run CISPRIP, and then capture the machine as an image. That can work. But it depends on someone remembering every single step. A month later, new Windows updates show up. A team asks for a different app. Security wants one registry setting changed. So somebody starts over, often from a set of notes that might be outdated, a script that only half works, and a few steps that live in one admin's head. You know how this ends? Two images with the same name can have different apps, different patches, and different settings. One person tests before capturing another skips a step because the deadline is tight. That's not a people problem. It's a process problem. I'm Mirko Peters from M365FM, and this knowledge nugget is about turning that hand-built routine into a repeatable Azure process. By the end, you'll know what Azure Image Builder does, what it doesn't do, and why it helps you create the same approved starting point every time. So what exactly is Azure Image Builder? What Azure Image Builder actually is? Azure Image Builder is an Azure service that creates customized virtual machine images from a set of instructions you define. That's the plain English definition. Think about a company laptop that IT has already prepped. It has Windows installed, the right security setting supplied, the approved tools added, and the unwanted software removed. Instead of preparing every laptop by hand, you create one master copy you can use again and again. A virtual machine image works the same way. It's a prepared starting copy for new virtual machines. You can start with a clean Windows or Linux image from Azure Marketplace. That might be Windows Server, Windows 11, Ubuntu, or another supported operating system. You can also begin with an image your company already created like a managed image or one stored in Azure Compute Gallery. So you don't always start from zero. Maybe your organization already has a secure Windows Server based image. Azure Image Builder can begin there, apply the next set of approved changes, and create a newer version. Or maybe you start with Microsoft's latest Windows 11 image and add your company's standard tools and settings. Either way, the idea stays simple. You start with a known source. You define what should change. Azure creates a new image. Now many people hear the word builder and assume it creates virtual machines for users or applications. It doesn't work that way. Azure Image Builder creates the image first. Later you create 1vm, 10vm, or a much larger group from that finished image. So it belongs earlier in the process, like preparing the master copy before anyone starts handing out copies. That distinction saves a lot of confusion. Azure Image Builder also uses HashieCork Packer behind the scenes. Packer is a tool that automates image creation, but Azure Image Builder puts an Azure managed layer around that work. You don't need to run and maintain your own Packer Server just to use the service. As your handles, most of the temporary build work, while you focus on the instructions for your image, you still need to define what you want. For example, you might want an image with current Windows updates, a browser, a monitoring agent, a security agent, and a few company settings. Instead of logging in and doing that work by hand every month, you write down those requirements once as part of the image build. Then the same instructions run again on the next build. That means every new vm starts with the same apps, the same patches, the same settings, and the same security baseline. If something needs to change, you update the instructions and build a new image. Instead of hoping every administrator follows the same list, that's the real reason to automate images. You're not just saving time during setup. You're replacing memory and manual work with a process you can repeat. The definition helps, but the next part makes the whole service easier to see. An image build has a few simple building blocks, and each one has a clear job. The five building blocks of an image build, let's picture the image build as preparing a new office before a team moves in. First, you need the empty office. That's your source image. The source is the clean starting point as your image builder uses for the build. Maybe it's Windows Server for an application server. Maybe it's Windows 11 for a desktop environment, or maybe it's Ubuntu for Linux Workload. You choose the source based on the job the future vm's need to do. For example, a web server team might start with Ubuntu. A finance application that usually needs Windows Server. And an Azure Virtual Desktop team will likely choose Windows 11. The source gives you the operating system, but it doesn't yet contain your company's setup. Think of it as an empty office with the walls, doors, power, and network already in place. The next building block is customization. This is where the setup crew comes in. You give Azure Image Builder scripts and instructions that describe what belongs in the office before people arrive. A script can install an application. Another can apply Windows updates. One might add a language pack for users in a certain country. You can also install a monitoring agent so your operations team can see whether the vm is healthy. You might add a security agent that checks for threats, or you might apply security settings, such as turning off an old protocol, setting a company time zone, removing unwanted software, or adding a required certificate. The order matters. If an application needs a certain Windows feature, install the feature first. If a security setting would block an installer, add the application before applying that setting. Azure Image Builder runs your customizations in the order you define. So the image instructions should read like a sensible work list. And here's where people often try to put everything into one giant script. That usually becomes hard to test and harder to fix. Smaller scripts work better because each script has one clear job. One installs the monitoring agent, another applies security settings. A third checks that a required app exists. When something fails, you can see which part needs attention without reading through hundreds of lines of unrelated code. After the setup crew finishes, you need an inspection. That is validation. Validation means checking the completed image before other teams begin using it. Maybe you test that an application installed successfully, or you confirm that a server starts. Perhaps you check that a security setting has the expected value. The point is simple. Don't publish an image just because the installation did not report an error. An installer can finish while the app still fails to open. An update can require a restart. A setting can apply differently than you expected. Validation gives you a place to catch those problems while you still have one build, rather than discovering them after many new VMs start from that image. Picture a new office again. The furniture is in place, the computers are connected and the doors lock. Before employees move in, someone checks the lights, the meeting room screen and the access cards. That check avoids a poor first day for everyone else. Once the image passes validation, it needs a home. That is distribution. As your image builder can publish the finished image to as your compute gallery, as a managed image, or as a VHD file, a VHD is a virtual hard disk file useful when you need an image file for another supported use. For most teams building images for regular Azure VM deployments, as your compute gallery is the usual home, think of it as the filing room that holds approved office blueprints. People don't walk in and grab a random sketch from someone's desk. They use the approved blueprint from the filing room. A managed image can still work for simpler cases. But the gallery gives you a more organized place to keep image families and their releases. We'll spend more time on that shortly because it changes how teams share images across regions and workloads. The last building block is versioning. Every new build should create a new version. That sounds small, but it changes how you manage risk. Suppose your image from April contains Windows updates, a browser update, and version 4.2 of a company agent. Your may image includes the next patch set and version 4.3 of that agent. With versions, you can tell which release a VM came from and when it entered use. You also keep a clear record of change. If a new app update causes trouble, you can choose the earlier approved version while you investigate. Without versions, teams often override the only image they have then struggle to work out what changed. So the full process looks like this. Choose the empty office, send in the setup crew, inspect the finished space, file the approved blueprint where people can use it, then label every approved revision. That's a repeatable image build. Next, let's follow one image from a clean Microsoft starting point to a company standard that can be used again and again. What happens behind the scenes? So far, we've looked at the parts of an image build. Now let's look at what Azure actually does when you press build. Everything starts with an image template. Think of the template as the instruction sheet for one repeatable job. It tells Azure where to begin, what work to do, where the finished image should go, and who is allowed to access the resources needed along the way. The template includes the source image, it also lists the customizations such as power shell scripts for windows or shell scripts for Linux. It can include build settings like the location and network Azure should use while it creates the image. Then it names the destination, perhaps an Azure compute gallery image version. There's also an identity attached to the template. This part can sound technical, but the idea is simple. Azure needs permission to do work in your environment. It needs to read files from storage, create temporary build resources, use a network when you provide one, and write the finished image to its destination. That identity controls those permissions. Think of managed identity as the reception desk for the build process. A person arrives and asks to enter the building, collect a package, or access a restricted room. The reception desk checks who they are and what they're allowed to do. I managed identity does the same job for Azure resources. Instead of putting a username and password inside your scripts, you give the managed identity the right access through Azure roles. It can read the installer files it needs. It can create the temporary resources for the build, and it can publish the result to the gallery. It should only have the access it needs. That limits the damage if a script is wrong or an account is misused. The image build doesn't need permission to control every resource in the subscription. It needs enough permission to complete its assigned work. After Azure accepts the template, it creates temporary resources for the build. One of them is a temporary virtual machine. This VM is not the server your users will run later. It is the workshop where Azure prepares the image. Azure also creates supporting resources such as disks, network parts, and storage used during the build. You may see these resources appear in a staging resource group that can surprise people the first time. They create one image template, then suddenly see a VM, a disk, network resources, and a storage account. Nothing has gone wrong. Azure needs a real VM to install software, run updates, and apply your settings. The temporary VM gives Azure a place to do that work without changing your source image. Then the instructions begin to run. Azure runs your scripts in the order you put them in the template. A first script might install a company browser. The next one might install the security agent. Another might run Windows update. A later script could remove a built-in app your company doesn't want. Or apply a setting that blocks an older security protocol. The order is part of the design. Suppose a security agent needs the latest Windows update before it installs correctly. Your update script needs to run first. Or perhaps an installer forces a restart. Your next script needs to wait until the machine comes back and confirms the earlier step finished. This is why image scripts should be predictable and fully automatic. A script that opens a window and waits for someone to click. Next can stop the whole build. The temporary VM has nobody sitting in front of it. Use silent install options, wait for commands to finish, and return clear success or failure results. Picture a simple monthly build. You begin with the current Windows server source image. The build installs the month's Windows updates, updates the approved browser, and installs or updates the company security agent. It then applies the company settings that belong on every server. You build that once after that every new VM created from the image starts with those changes already in place. You don't wait for each VM to download the same updates. You don't repeat the security agent installation 10 times or 100 times. The preparation happened before the VMs existed. Once the script's finished, Azure prepares the completed VM to become an image. For Windows, that process includes generalization, often called CISPrep. Generalization removes details that belong to that one temporary machine. A VM name, machine specific identity and similar local details should not be copied into every future VM. You want a clean starting point. Otherwise, new VMs could arrive with pieces of the temporary build machine still attached. Generalization lets each new VM form its own identity when it starts. When that work succeeds, Azure captures the prepared VM and publishes the finished copy to the destination you selected. Then the temporary build VM and most supporting resources are removed. The build workspace disappears because you no longer need it. The image remains. Azure also keeps build information you can review, including logs. If an application installs a fails or a validation step reports a problem, those logs show where the build stopped and what the script reported that makes image building easier to investigate than a manual process where someone only remembers that it worked last month. So, the template describes the work. Azure creates a temporary workshop. The managed identity opens only the doors the build needs. Scripts prepare the machine, Azure generalizes it, and the finished image gets published. But a finished image only helps when people can find the correct release, use it in the right Azure region and return to an earlier release when a newer one causes trouble. Azure compute gallery, the image library. So once Azure image builder finishes its work, you need a place to keep the result. That places Azure compute gallery. Now, many people treat it like a storage folder for VM images, but it's actually much more than that. Think of it as a company library for approved images, complete with names, releases, regional copies, and a clear history of what people should deploy. Let's talk about the difference between a folder called Final Images and a proper library system. In a folder, you might find files named Final Final 2, Final New and Really Final, and nobody feels confident choosing one. A library gives each item a clear label and keeps different additions together. An Azure compute gallery works the same way for your VM images. The first part is the image definition, which is like the name for an image family. It describes the type of image you're managing, not one specific build. For example, you might create an image definition called approved Windows 11 desktop, and that definition tells people what kind of image they're looking at. It might describe a Windows 11 image for Azure Virtual Desktop, or a Windows Server image for internal application servers. Here's the thing, the definition stays in place over time, even as you release newer builds. Under that definition, you create image versions, where each version is one exact release. Your April build might include that month's Windows updates, the current browser version, and the approved company agent, and that becomes one version. Your May build becomes another version under the same image definition, so the definition is the family name. The version is the specific copy you deploy. This separation keeps things clear when someone asks a simple question, which image are we using? You can answer with the image definition and the exact version, which is much better than saying, we use the latest one, especially when a problem appears later. Now, a gallery also helps when your VMs live in more than one Azure region. Imagine your main team deploys VMs in West Europe, while another team deploys the same standard image in North Europe. You don't want to wait for a large image to travel across regions at the moment you need to build many VMs. Instead, Azure Compute Gallery can replicate image versions to the regions where you expect to use them, meaning Azure places copies of that approved image version closer to the workloads that need it. That helps with speed, but it also helps with planning. If you know a large deployment is coming in another region, you can make sure the image version already exists there, so the deployment process can use a local copy rather than depend on the last minute transfer. Rapplica Count matters too. A Rapplica is another available copy of the image version within a region. When you deploy many VMs at the same time, Azure needs enough image capacity to supply them. A small deployment may need very little, but a large host pool, a scale-out event, or a recovery exercise may need more. So you choose the number of replicas based on how many VMs you expect to create at once. This is one of those details people don't notice until a deployment slows down. There is another reason image versions matter. Rollback. Let's say you publish a new image version with a browser update. Testing looked fine, but users later find that a business app no longer works with that browser release and you don't need to rebuild the old image from memory. You can select the earlier known good image version for the next deployment while you investigate the newer one, giving teams a controlled way back instead of a rushed repair. A managed image can still be useful for a simple local use case, but Azure Compute Gallery adds the parts that become important as usage grows, image families versions, regional replication, and wider reuse across teams and deployments. It turns a finished image into something people can identify, share, and use with confidence. The process sounds tidy on paper, but in real environments the failures usually happen around permissions, networks, policies, and scripts rather than the image itself, the parts that usually break. Most Azure image builder problems don't come from the image idea itself. They come from the connections around it. Permissions are usually first on the list. The managed identity needs permission to create the temporary resources used during the build, and it also needs permission to read the files it needs and publish the finished image to the destination you selected. But don't give it broad access just because of build fails. Give it the access required for its job and no more. If it needs to publish to an Azure Compute Gallery, give it the right access there. If it needs to read in-stallers from a storage account, give it read access to that storage location. A build identity shouldn't become an all-access account for your subscription. Network access is another common issue. The temporary build VM needs to reach the things your instructions depend on, including a script location and application installer, Windows Update Linux Package Sources, or Azure Services used during the build. A script can look perfect on paper and still fail because the VM cannot reach the download address. This often appears in locked-down environments. Your normal company VM may use a proxy, a private route, or a firewall rule that the build VM doesn't use. So before you start, ask a simple question. From the build network, can the temporary VM reach every place this image needs? Private storage needs a little more thought. You may keep installers, certificates, and scripts in a private Azure storage account, which is sensible. But the build still needs an approved way to reach those files. Don't solve that by making sensitive files public. Instead, set up the access path properly. The managed identity may need permission to read the files, and your network settings must allow the build VM to reach the storage account. Private doesn't mean unreachable. It means only approved identities and networks can get in. Security settings can also create a mismatch before customization even begins. For example, a source image may use a certain generation or security type, such as trusted launch support. The build setup and destination image settings need to match what that source supports. If they don't match, Azure can stop before your first script runs. So check the source image details early, check the image definition, and check the build VM settings. A secure source image is still usable, but the rest of the build needs to follow the same rules. Then there are the controls outside the template. Azure Policy can block a temporary disk type, network setting, or storage choice that as your image builder tries to create. And as your service provider that hasn't been registered can stop part of the build as well. This can feel confusing because your template may be correct, but the service simply can't create one of the resources it needs. Before spending hours changing scripts, check policy assignments and confirm the needed Azure resource providers are registered in the subscription. Scripts deserve their own discipline. Test every script on a normal VM before you add it to an image build. Make sure application installs run silently and make sure the script waits for installers to finish. Plan for restarts because updates and agents can require them. Also check exit codes, a script that reports success after an installer failed creates a bad image quietly. Your script should stop and report an error when a required step doesn't complete. When a build does fail, start with the last run status that tells you where Azure stopped. After that, look at the logs in the Packer Logs container in the staging storage account. Start with the customization log when a script failed and check the validation log when the build completed its changes but failed to check afterward. Those logs turn the image build failed into a specific answer. Start with one small image, one source image, one or two scripts and one output location. Prove that process first then let image updates become part of normal operations rather than an emergency project each month. A simple first image builder plan. So what's the simplest way to get started with Azure image builder? Think of it like a recipe. Start with one common VM type, one approved base image and a short list of changes you repeat every time. Keep that first template small. Just a source image, your customizations, one validation check as your compute gallery as the destination and a clear version number. Store your installers and scripts in a controlled location and use managed identity to read them when it makes sense. Managed identity is like a secure badge. It lets your scripts access resources without hard coding passwords. Choose a family name that makes sense to your team like Windows 11 standard and use a simple version pattern like 2026.07. One, before you go to production, create one test VM from that new version and check the app, agent updates and settings in a real environment. Once that works, put the build into Azure DevOps or another pipeline. Run it regularly for monthly patches and run it again whenever an urgent security update arrives. Bake the stable foundations into the image but deliver fast changing apps separately when that makes more sense. A repeatable image process doesn't just change how you build VMs. It changes your whole approach. So how do you put this process to work? Azure Image Builder replaces those hand-built golden images with a repeatable Azure process. Your next task is simple. List every app, setting, update, and check your team repeats when preparing a VM. Then choose one base image, publish one tested version to Azure Compute Gallery and start learning how Compute Gallery managed identities and image update pipelines all fit together.