Azure snapshots as VM templates
Solution 1:
Given you need persistence, then you need to use VM's rather than VM scale sets, which might have made the updating easier.
The approach you are going with currently will work to initially create the VM, but as you pointed out, updates are going to be a pain. Once the VM is created it is effectively independent of the snapshot and you will need to update each VM separately. If that is just OS updates it's not so bad, but if you want to do software and configuration updates then it can become painful.
To deal with this there are a few options:
- Instead of using snapshots, create custom images. You can autoamte this using the VM image builder. When you want to do an update, build an updated image then roll it out to your VMs
- Create VM's as a one off from the snapshot, then move your update management outside the VM, using things like Azure Update Management for OS patches, and configuration management tools like Puppet, Chef, Ansible for software management
- Persist the user data on separate disks in the VM, not the OS or data disk. When you want to update create a new snapshot, destroy the old VM, create a new one and attach the disk.