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
| Parameter | Type | Required | Description |
|---|---|---|---|
subscriptionId | string | Yes | Azure subscription ID where resources will be deployed |
location | string | Yes | Azure region for resource metadata (e.g., ‘westeurope’) |
paramsImage | array | Yes | Array of image configuration objects |
Image Configuration Object
Each image object in the paramsImage array contains:
| Parameter | Type | Required | Description |
|---|---|---|---|
parImageName | string | Yes | Display name for the marketplace image |
parResourceGroupName | string | Yes | Resource group containing the custom location |
parSubscriptionId | string | Yes | Azure subscription ID |
parExtendedLocationName | string | Yes | Name of the custom location (Azure Stack HCI cluster) |
parOsType | string | Yes | Operating system type (‘Windows’ or ‘Linux’) |
parPublisherId | string | Yes | Publisher ID from Azure Marketplace |
parOfferId | string | Yes | Offer ID from Azure Marketplace |
parSku | string | Yes | SKU from Azure Marketplace |
parSkuVersion | string | Yes | Specific version of the SKU |
parHyperVGeneration | string | Yes | Hyper-V generation (‘V1’ or ‘V2’) |
parTags | object | No | Resource 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.
!!!As always, use at your own risk and wisely!!!
