I am planning on using an App Gateway with a Virtual Scale Set to host an custom-built IIS website. I need a way to get the code onto the servers, configure server settings, etc. on the VMs in the scale set each time the website is deployed. The deployments will be kicked off in Azure DevOps (though that could simply call something else, e.g. an Azure Automation runbook). The artifacts could be stored anywhere; maybe in an Azure blob storage account. I am trying to figure the best way to do this.
I found a blog post about baking the apps into your scale set VM images. I will install IIS and other prerequisites in the image used to deploy the VMs in the VMSS. But the app itself will be updated regularly. Re-imaging is super-slow, and much less efficient than just pushing out new binaries.
Another option would be to use the Custom Script Extension. When changing versions of the code, I could change the script extension and rely on VMSS auto-update to run the new script extension on all the instances in the VMSS. Basically what is outlined here. All the VMs will need to access the storage, and the scripts would be running 100% locally.
A third option (my personal preference if possible) would be to kick off a central script (e.g. in Azure Automation) that would copy the files and perform whatever steps are necessary to get the new version running on each node. Ideally I would even drain each node in the App Gateway before updating it. I could use commands like Invoke-AzVmssVMRunCommand to run commands on the VMs in the Scale Set. (I've had a hard time figuring out how to copy the new files to the computer, which seems like it should have been easy.) This script could also be triggered on scale-out when a new VM is added to the Scale Set.
Are there other options I should consider? Any comments on the three above?
Thanks,
Eric