Compare custom images and formulas in Azure DevTest Labs

In Azure DevTest Labs, both custom images and formulas can be used as bases for creating new lab virtual machines (VMs). The key distinction between custom images and formulas is that a custom image is simply an image based on a virtual hard drive (VHD). A formula is an image based on a VHD that also includes preconfigured settings. These settings can include VM size, virtual network, subnet, and artifacts. Preconfigured settings are set up with default values that you can override when you create the VM.

In this article, you learn the pros and cons of using custom images versus formulas. You can also read Create a custom image from a VM and Create a formula from a VM for more details.

Custom image benefits

Custom images provide a static, immutable way to create VMs from the environment you want.

Pros Cons
VM provisioning from a custom image is fast. Nothing changes after you create a VM from an image.

There are no settings to apply. The custom image is just an image without settings.

VMs created from a single custom image are identical.
To update an aspect of the custom image, you must recreate the image.

Formula benefits

Formulas provide a dynamic way to create VMs from the configuration and settings you want.

Pros Cons
Changes in the environment can be captured on the fly by using artifacts. You can use a formula to create a VM installed with the latest bits from your release pipeline. A formula also works when you want to enlist the VM with the latest code from your repository. The formula can specify an artifact that deploys the latest bits or enlists the latest code, together with the target base image. Whenever you use this formula to create VMs, the latest bits or code are deployed or enlisted to the VM.

Formulas can define default settings that custom images can't provide, such as VM sizes and virtual network settings.

The settings saved in a formula are shown as default values. You can change these values when you create the VM.
Creating a VM from a formula can take more time than creating a VM from a custom image.

Get started with Azure DevTest Labs

New to Azure? Create a free Azure account.

Already on Azure? Create your first lab and get started with Azure DevTest Labs in minutes.