To create a custom Windows image with cloudbase-init for Azure:
Deploy a Windows VM
Connect to the VM using RDP
Download the right cloudbase-init installer from https://github.com/cloudbase/cloudbase-init
Run the installer:
Do not select the Use metadata password checkbox, because Azure does not support password setting through metadata.
Click Next
Select the checkboxes to Run Sysprep… and Shutdown when Sysprep terminates.
Do not click Finish yet.Go into the VM console and edit the cloudbase-init-unattend.conf file (at C:\Program Files\Cloudbase Solutions\Cloudbase-Init\conf by default) and set the following options:
metadata_services=cloudbaseinit.metadata.services.azureservice.AzureService plugins=cloudbaseinit.plugins.windows.createuser.CreateUserPlugin,cloudbaseinit.plugins.common.setuserpassword.SetUserPasswordPlugin,cloudbaseinit.plugins.common.userdata.UserDataPlugin first_logon_behaviour=no
Click Finish
Go to the Azure portal and save a snapshot of the VM to create the custom Windows image.