Share via

Consistent RDP Connection to VMs

John 0 Reputation points
2026-03-31T22:04:43.1233333+00:00

I'm unable to figure out how to have a Windows VM be permanently accessible. They are being either automatically shut down, deallocated, or in some cases still running but RDP loses the ability to connect. The issues don't get resolved unless I log back into Azure and either restart it or re-initiate RDP with JIT connect running its checks, or sometimes waiting an hour and then the connection works again. How do I configure one to simply stay on and remain accessible via RDP reliably?

Azure Virtual Machines
Azure Virtual Machines

An Azure service that is used to provision Windows and Linux virtual machines.

0 comments No comments

1 answer

Sort by: Most helpful
  1. Jilakara Hemalatha 11,600 Reputation points Microsoft External Staff Moderator
    2026-04-01T00:14:13.41+00:00

    Hello John,

    Thank you for reaching out regarding your Azure Virtual Machine (VM) stopping, deallocating, or experiencing intermittent reboots. Based on your description, there are several reasons why a VM may stop or become inaccessible and understanding these will help ensure continuous availability.

    1. Auto-Shutdown Feature:

    Azure provides an Auto-shutdown feature designed to save costs by automatically shutting down VMs during periods of inactivity. If this is enabled on your VM, it will be deallocated according to the configured schedule, rendering it temporarily inaccessible via RDP.

    To verify and disable this feature: navigate to your VM in the Azure portal → Operations → Auto-shutdown and turn it off if required.

    Reference: Auto-shutdown a virtual machine

    1. Spot VM Behavior:

    If your VM is deployed as a Spot VM, it can be deallocated at any time based on capacity availability in the selected region or if the market price exceeds your maximum set price. Spot VMs are ideal for cost-sensitive, non-critical workloads but are not guaranteed to remain running. You can mitigate this by resizing the VM to a standard size or creating a new VM from existing disk snapshots.

    Reference: Azure Spot Virtual Machines

    1. Subscription, Quota, and Billing Considerations:

    VMs may also stop or deallocate if your subscription credit expires or if there is a billing issue. Verify your subscription status in the Azure portal under Cost Management + Billing. Additionally, ensure that your resource usage has not exceeded subscription quotas by checking Subscriptions → Usage + Quotas

    Reference: Azure subscription and service limits, quotas, and constraints

    1. Planned and Unplanned Maintenance:

    Azure periodically performs maintenance for performance, security, and reliability improvements. This includes both planned maintenance, which is communicated via Service Health, and unplanned maintenance, which can trigger automatic VM reboots or migrations

    Reference: Understand a system reboot for Azure VM

    1. Automation, Configuration Changes, and Updates:

    Other common causes of VM reboots include automated scripts, configuration changes (e.g., resizing, changing static IP, or admin passwords), and Windows Updates triggered by Azure Security Center. It is recommended to review any automation tasks to ensure they are not causing unintended shutdowns or restarts.

    Reference: automate the shutdown of your VMs

    VMs with attached VHDs - If your VM has a large number of attached VHDs it's possible to exceed the scalability targets for your storage account which would cause a reboot. Read more about the guidelines for VMs with attached VHDs .

    If the physical server hosting the VM experiences faults or becomes unresponsive, the Azure Host Agent may reboot the VM. Typically, the VM is back online within a few minutes. If a host cannot be rebooted, Azure performs auto-recovery, migrating the VM to a healthy host, usually completing within 15 minutes.

    Also please refer below documentation to troubleshoot disconnects frequently in Azure VM

    https://dotnet.territoriali.olinfo.it/en-us/troubleshoot/azure/virtual-machines/windows/troubleshoot-rdp-intermittent-connectivity

    Hope this helps! Please let me know if you have any queries in comments.


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.