Forum Discussion
BerndLoehlein
Microsoft
Apr 21, 2021Deallocate VM on user logoff
Recently we've announced the public preview of start VM on connect which will allow your deallocated virtual machines getting started automatically when the assigned user tries to connect. Let us hav...
- 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.
HenryGelderbloem
Aug 12, 2021Copper Contributor
I've been having an issue with this, so much so I've had to use a different method. What happens when users log out is that the user session is not correctly removed. This means when they try to login thier VM doesn't start. We get the error ConnectionFailedUserHasValidSessionButRdshIsUnhealthy (-2146233088).
PatrickBrack
Sep 01, 2021Copper Contributor
HenryGelderbloem same here. Tried also an option with an Azure Function which checks for active sessions and shut down the VM with the Stop-AzVM PowerShell command. Same issue. The start on connect feature throws the same error.
Can you probably share which method you finally used to avoid this error?
- HenryGelderbloemSep 06, 2021Copper ContributorMy workaround was to not use this method at all. I have configured it in a way that shuts down the VM if the user logs out (or is logged out due to being idle). I then have an Azure Function that runs every 30 minutes and checks for VMs that are powered off but not deallocated. If they are powered off but not deallocated, they are then deallocated.
- BerndLoehleinSep 20, 2021
Microsoft
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.