Azure VM Scale Set with Custom Image

Hi,

I tried to deploy an Windows VM Scale Set with custom Image from a shared Image Gallery. Version of azurerem is 2.8.

The deployment works if i specify a marketplace image like:

source_image_reference {

publisher = "MicrosoftWindowsServer"

offer     = "WindowsServer"

sku       = "2016-Datacenter-Server-Core"

version   = "latest"

}

If I specify a custom image

source_image_id {
id = data.azurerm_shared_image.vmss2019iis.id

It fails with the message that source_image_id is not expected here.

Is this a known issue?

PS: the id works, verified it in the output

Full error message:

Error: Unsupported block type

on vmss.tf line 24, in resource “azurerm_windows_virtual_machine_scale_set” “vmss”:
24: source_image_id {

Blocks of type “source_image_id” are not expected here. Did you mean to define
argument “source_image_id”? If so, use the equals sign to assign it a value.