I would like to use our custom made image (various OS) from the Azure compute Gallery (formerly known as Shared Image Gallery) for machine creation. All details such as ID, sku, provider etc. obtained via Azure CLI.
However when I use respective block in virtual machine definition supreme block:
publisher = “OurCompanyName”
offer = “OurCustomName”
sku = “OurCustomSKU”
version = “latest”
I am getting this error:
“Failure sending request: StatusCode=404 – Original Error: Code=“PlatformImageNotFound” Message=“The platform image ‘Kyndryl:rh91-1:rh91-1:latest’ is not available. Verify that all fields in the storage profile are correct. For more details about storage profile information, please refer to StorageProfile Class (Microsoft.Azure.Management.Compute.Models) - Azure for .NET Developers | Microsoft Learn” Target=“imageReference””
I have find out that this method cannot be used for Compute Gallery (Shared Image Gallery) anymore because there has been changes made in Compute API which the block is using for API calls and therefore it is not able to properly reference the custom image, see:
As alternative I was suggested to use “storage_image_reference” block instead, however when I used that I have got this error:
“Error: Unsupported block type”
“Blocks of type “storage_image_reference” are not expected here.”
So my question is what is currently functional solution to use custom image from Compute Gallery (Shared Image Gallery) when creating a new vm with Terraform? Thank you.