简体   繁体   中英

Azure VM suspends running software when not connected through Remote Desktop

I created a new Azure Windows VM, on which we installed our custom .NET software (not a service) that sends out payslips for a client using Microsoft Outlook 2019. Our software opens a new Outlook email, inserts the necessary text, attaches the payslip, and sends the email.

Whilst connected through Remote Desktop, using the local administrator account on the VM, the software operates as expected, successfully opening a new email and sending through Outlook.

However, when I disconnect from the VM (not logging off, only closing the Remote Session), the software is 'suspended', ie no emails are created by our software. In addition, queued emails in the Outbox of Outlook is also suspended and not sent out until we log onto the VM again.

When we originally hosted a VM on our local Microsoft Server 2016, with the same setup as the Azure VM, disconnecting the Remote session did not suspend our software. This leads me to believe that it is a specific setting on Azure that we are missing.

Can anyone please provide some insight into why the VM is suspended on Azure when we disconnect the remote session?

FOLLOW UP COMMENTS

I am running clean install Windows 10 Pro v1903 VM's from Azure. Windows is up to date. All power and screen settings are turned off/disabled. I have the same problem on the second Azure Windows 10 VM, so the problem is not unique to one installation.

I further explored Windows idle issues, with this thread being my best hope. https://answers.microsoft.com/en-us/windows/forum/windows_10-windows_install/windows-10-keeps-going-into-sleep-after-1-minute/787e8cea-32ce-4ea0-a281-13c32a75352d?auth=1 . It however did not resolve the problem.

I also tried: Open gpedit.msc. Browse to Computer Configuration --> Administrative Templates --> Windows Components --> Remote Desktop Services --> Remote Desktop Session Host --> Session Time Limits. Enable the "Set time limit for disconnected sessions" and set it to Never, but to no avail.

I can simplify the problem as follows: I set Outlook to Offline mode, queue 10 emails, turn Outlook back to online and quickly disconnect the remote session. I would expect that the emails should be sent. This however does not happen and is only sent when I log back into the remote session.

I believe the problem might be with the user being 'logged out' when I disconnect the remote session. Bear in mind that we have an older Windows 10 VM running on our local Microsoft Server 2016, which does not log out the remote user when the remote session is disconnected. Importantly, the Windows 10 VM version on our local server is v1809. Might this be a clue?

When you disconnect the remote session via clicking the right corner X symbol in the windows on the Azure Windows Server 2016 Datacenter, you will see the following message. 在此处输入图片说明

It means that the program on the remote computer will continue to run after you have disconnected the current remote session. You could try to disconnect the session via this way or try to find some clues via access to the event viewer --- windows logs --- system.

Another suggestion is to create another VM with a different image or the same image to compare the result as your current VM. Check if the VM has installed the latest update and the power option is set to never put the VM to sleep.

All applications run under a security context in windows. A specific user starts a Windows session when he/she logs in, and all running applications will be terminated when the session is terminated.

For a user account to be able to run applications without a Windows session, you have two options; make the app a service, and give the account right to login as a service, or use the Windows Scheduler "Run whether user is logged on or not".

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM