Packer / Sysprep error - IMAGE_STATE_UNDEPLOYABLE on Azure

The problem

Part of the Packer build process is to generalize the image ready for deployment.

At the time of writing (Aug 2021) Following the guidance from the Packer docs, it says you should add the following config to achieve this (I’m using HCL, not JSON):