Hello @KK1969
Thank you for reaching out to the Microsoft Q&A platform.
The best way to migrate your on-premises VMs to Azure VM Scale Sets would be to use the Azure Migrate tool. This tool helps you to replicate your VMs to Azure and then you can use the replicated VMs to create a custom image. This custom image can then be used to create the Azure VM Scale Sets.
Regarding the deployment of code changes, you can use Azure DevOps to automate the deployment process. You can create a pipeline in Azure DevOps that will deploy the code changes to the Azure VM Scale Sets. This way, you can ensure that the deployment process is seamless, and you don't have to manually deploy the code changes to each VM in the VM Scale Sets.
You can find more information on how to migrate your VMs to Azure VM Scale Sets in the following document: https://learn.microsoft.com/en-us/azure/virtual-machine-scale-sets/flexible-virtual-machine-scale-sets-migration-resources
If this does answer your question, please accept it as the answer as a token of appreciation.