是否可以使用 Terraform 在 Azure 上创建专用映像?如何?

Is it possible to create a specialized image on Azure with Terraform? How?

是否可以使用 Terraform 在 Azure 上创建专门的 VM 映像?如何?我已经将 .vhd 上传到存储帐户。

更新

目前,无法使用内置 Terraform 的专用映像为 Azure VM 提供 VM。作为解决方法,我们可以使用 terraform.

调用 PowerShell scripts with local-exec Provisioner or deploy ARM template

来自 ArcturusZhang 的评论 azurerm_windows_virtual_machine fails to create when referencing a "specialised" shared gallery image.,

Despite that now azurerm provider supports creating specialized image, it does not support provision VMs or VMSSes by using the specialized images. It is implementing in PR #7524 but it is currently blocked by some inconsistency in the compute API of azure. Please stay tuned.

此外,当我们 capture an image of the OS Disk 时,目前唯一的值是 Generalized for os_state with azurerm_image.