Caution
This article references CentOS, a Linux distribution that is End Of Life (EOL) status. Please consider your use and planning accordingly.
Generalizing or deprovisioning a VM is not necessary for creating an image in an Azure Compute Gallery unless you specifically want to create an image that has no machine specific information, like user accounts. Generalizing is still required when creating a managed image outside of a gallery.
Generalizing removes machine specific information so the image can be used to create multiple VMs. Once the VM has been generalized or deprovisioned, you need to let the platform know so that the boot sequence can be set correctly.
Important
Once you mark a VM as generalized
in Azure, you cannot restart the VM.