Forum Discussion
Deallocate VM on user logoff
- Sep 20, 2021
Could you please try to update the custom role used for Start VM on Connect and add Microsoft.Compute/virtualMachines/instanceView/read to it? This should ensure that sessions are removed in the service upon deallocation of the virtual machine.
We've already updated our docs for Start VM on Connect, but could be easily missed by customers already using this feature.
BerndLoehlein This is awesome and I appreciate you sharing your scripts! Do you know if this will be baked into the WVD offering in the future?
One thing I wanted to call out for the community is you have to ensure you don't allow your users the ability to restart the VMs from within the OS as this will cause the script to kick off and deallocate the VMs without ever rebooting the VM. You can block this with a GPO as well.