What's new in Azure VM Image Builder

Applies to: ✔️ Linux VMs ✔️ Windows VMs ✔️ Flexible scale sets ✔️ Uniform scale sets

This article contains all major API changes and feature updates for the Azure VM Image Builder (AIB) service.

Updates

May 2024

Breaking Change: Case Sensitivity

Starting from May 21, 2024, Azure VM Image Builder's API version 2024-02-01 and beyond will enforce case sensitivity for all fields. This means that the capitalization of letters in your API requests must match exactly with the expected format.

Important Note for Existing Azure Image Builder Users

If you're an existing user of Azure VM Image Builder, rest assured that this change will not impact your existing resources. The case sensitivity enforcement applies only to newly created resources using API version 2024-02-01 and beyond. Your existing resources will continue to function as expected without any changes.

If you encounter any issues related to case sensitivity, please refer to Azure Image Builder's updated API documentation for guidance.

Previously, Azure Image Builder's API was more forgiving in terms of case, but moving forward, precision is crucial. When making API calls, ensure that you use the correct capitalization for field names, parameters, and values. For example, if a field is named “vmBoot,” you must use “vmBoot” (not “VMBoot” or “vmboot”).

If you send an API request to Azure Image Builder's API version 2024-02-01 and beyond with incorrect case or unrecognized fields, the service will reject it. You will receive an error response indicating that the request is invalid. The error will look something like this:

Unmarshalling entity encountered error: unmarshalling type *v2024_02_01.ImageTemplate: struct field Properties: unmarshalling type *v2024_02_01.ImageTemplateProperties: struct field Optimize: unmarshalling type *v2024_02_01.ImageTemplatePropertiesOptimize: unmarshalling type *v2024_02_01.ImageTemplatePropertiesOptimize, unknown field \"vmboot\". There is an issue with the syntax with the JSON template you are submitting. Please check the JSON template for syntax and grammar. For more information on the syntax and grammar of the JSON template, visit http://aka.ms/azvmimagebuildertmplref.

The error message will mention an "unknown field" and direct you to the official documentation: Create an Azure Image Builder Bicep or ARM template JSON template.

Reference Azure Image Builder's Swagger for API Calls

When making calls to the Azure Image Builder service, always reference the Swagger documentation, which serves as the definitive source of truth for Azure Image Builder's API specifications. While the public documentation has been updated to include the proper capitalization and field names ahead of the API release, the Swagger definition contains precise details about each AIB API to ensure you are making calls to the service correctly.

Below is a list of the documentation changes that were made to match the field names in API version 2024-02-01:

In the Create an Azure Image Builder Bicep or ARM template JSON template documentation:

Fields Updated:

  • Replaced several mentions of vmboot with vmBoot
  • Replaced one mention of imageVersionID with imageVersionId

Field Removed:

  • apiVersion: We recommend avoiding the inclusion of this field in your requests because it is not explicitly specified in our API, so including it in your JSON template may lead to errors in your image build.

In the Azure VM Image Builder networking options documentation:

Field Updated:

  • Replaced one mention of VirtualNetworkConfig with vnetConfig

Fields Removed:

  • subnetName in the vnetConfig property – this field is deprecated and the new field is subnetId
  • resourceGroupName in the vnetConfig property – this field is deprecated and the new field is subnetId

How to Pin to an Older Azure Image Builder API Version

Important Consideration for Pinning to Older API Versions

Pinning to an older Azure Image Builder API version can provide compatibility with your existing templates, but it's not recommended due to the following factors:

  • Deprecation Risk: Older API versions may eventually be deprecated.

  • Missing Features: By pinning to an older API version, you miss out on the latest features and improvements introduced in newer versions. These enhancements often improve performance, security, and functionality.

If you’d like to avoid making changes to the properties in your image templates due to the new case sensitivity rules, you have the option to pin your Azure VM Image Builder API calls to a previous API version. This allows you to continue using the familiar behavior without any modifications.

To ensure compatibility with your existing templates, when creating or updating an image template, specify the desired API version (e.g., api-version=2022-07-01) by including the api-version parameter in your call to the service. Example:

PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VirtualMachineImages/imageTemplates/{imageTemplateName}?api-version=2022-07-01