Azure Local | Bicep – Marketplace Images

Azure Local | Bicep – Marketplace Images


Azure Local makes VM deployment feel “cloud-like,” but there’s an important difference to remember: before you can deploy a virtual machine, the image must first be created and downloaded to your Azure Local instance as a VM image resource. That download step can take time, and doing it manually becomes painful when you run multiple clusters, operate in constrained edge locations, or need consistent golden images across environments.

Azure Local supports three practical ways to source those base images: from Azure Marketplace, from an Azure Storage account, or from a local share. In this post, we’ll focus on the Marketplace path and how to scale it using Bicep.

When you add an image from Azure Marketplace, you create an Azure Local VM image that can be reused for VM deployments on that instance. Under the hood, this maps nicely to the Microsoft.AzureStackHCI/marketplaceGalleryImages resource type, which is supported in Bicep and requires an extendedLocation pointing at your Custom Location.

Azure Bicep

I’ve been developing a set of reusable Azure Bicep templates to simplify Azure Local operations and reduce manual effort. Instead of importing Marketplace images one by one, these templates allow you to deploy multiple Azure Marketplace images to an Azure Local cluster in a single run, ensuring consistent naming, versioning, and repeatable results. The outcome is a faster, more standardized image onboarding process—ideal for environments where clusters must be built and maintained reliably at scale.

https://github.com/GetToThe-Cloud/Website/tree/main/AzureBicep-AzureLocal-MarketplaceImages

Features

  • ✅ Deploy multiple marketplace images from a single template
  • ✅ Support for Windows and Linux operating systems
  • ✅ Hyper-V Generation V1 and V2 support
  • ✅ Specific version pinning for consistent deployments
  • ✅ Custom resource tagging
  • ✅ Uses Azure Verified Modules (AVM) for Azure Stack HCI marketplace images
  • ✅ Pre-configured examples for common images (Windows Server 2022/2025, Windows 11 AVD)

Main Parameters

ParameterTypeRequiredDescription
subscriptionIdstringYesAzure subscription ID where resources will be deployed
locationstringYesAzure region for resource metadata (e.g., ‘westeurope’)
paramsImagearrayYesArray of image configuration objects

Image Configuration Object

Each image object in the paramsImage array contains:

ParameterTypeRequiredDescription
parImageNamestringYesDisplay name for the marketplace image
parResourceGroupNamestringYesResource group containing the custom location
parSubscriptionIdstringYesAzure subscription ID
parExtendedLocationNamestringYesName of the custom location (Azure Stack HCI cluster)
parOsTypestringYesOperating system type (‘Windows’ or ‘Linux’)
parPublisherIdstringYesPublisher ID from Azure Marketplace
parOfferIdstringYesOffer ID from Azure Marketplace
parSkustringYesSKU from Azure Marketplace
parSkuVersionstringYesSpecific version of the SKU
parHyperVGenerationstringYesHyper-V generation (‘V1’ or ‘V2’)
parTagsobjectNoResource tags as key-value pairs

The Version is preconfigured. If there is a newer version, you will see after deployment in the portal that it needs to be updated to the latest.