Hi Sebastien,
Why are you using that Start/Stop script? To reboot your VM or to save money by stopping the VM during the night?
If it is the cost-saving aspect, then you are doing it right, BUT you have to live with the "refresh" of the temporary drive because this is the expected behavior.
Your understanding of that process is correct. The shutdown initiates the deallocation of those discs.
The easiest and fastest way to keep your cache => add another (small) data disc to the VM and reconfigure your app to use the new disc as a cache location.
Or another option might be... create a PowerShell script that runs before the shutdown and makes a copy/backup of those cache folders to the C-drive... on startup, move those folders back to the temporary drive.
I hope my answer is helpful to you,
Your
Bjoern Peters
If the reply was helpful, please upvote and/or accept it as an answer, as this helps others in the community with similar questions. Thanks!