Azure VMs have only 2 states (i.e. start and stop), but you can certainly tweak this by using extension mechanism during VM creation.
We can do this hibernation as below steps.
Create an standalone application, which will do following things.
- Read your system "Recent File".
- Scan all the running process.
- Now based on process name and recently opened file from recent directory get their absolute path and store into some temp file.
- Make sure that file creation should overwrite old file, every time it execute.
- If file exist then during startup this application should opened all the listed file and launch process too.
Now, Store your above created executable file into some publicly access Storage account.
Write one power shell scripts where you can access above mentioned storage account and it will download step 1 created executable application into that VM, which will keep scanning and reading and storing all the recently opened applications into one temp file and during startup it should open too.
For getting download that executable into respective VM, you can use "Extension" mechanism while VM creation where you will attach power shell scripts.
So from next time, after deallocating your VM, whenever you will start that old VM again it will read that temp file where all the file name and process name was listed and opened that.
This way, you can achieve your hibernation process.
Hope these steps are clear, otherwise post an update so I provide more guidance.