created vm on azure with public opened rdp- working ok-but after a day rdp no longer accessible

365keaAdmin 0 Reputation points
2025-12-18T08:20:53.69+00:00

created vm on azure with public opened rdp- working ok-

but after a day rdp no longer accessible

bastion also not working

deleted the vm

recreated everything - and same behaviour

tried rebooting- no help

why in the first day its working and accessible and the next day not?

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. JimmySalian-2011 44,731 Reputation points
    2025-12-18T18:07:01.2966667+00:00

    Hi 365 Admin,

    Did you carried out the standard troubleshooting to check the NSG rules and local internet, also router firewall if RDP is allowed or setting some policies?

    Please have a look at the troubleshooting guide this has assisted me few times so hope this helps you.

    https://learn.microsoft.com/en-us/troubleshoot/azure/virtual-machines/windows/troubleshoot-rdp-connection

    Hope this helps.

    JS

    ==

    Please Accept the answer if the information helped you. This will help us and others in the community as well.

    0 comments No comments

  2. Manish Deshpande 1,500 Reputation points Microsoft External Staff Moderator
    2025-12-19T18:46:16.59+00:00

    Hello 365keaAdmin

    it sounds like you're having a frustrating issue with RDP access to your Azure VM. Since the RDP was working initially and then stopped after a day, there are several potential reasons this can happen. Here are some troubleshooting steps you can try:

    • Check if Windows Firewall is blocking RDP

    Use Run Command in Azure Portal (this works even when RDP is down):

    Portal → VM → Run CommandRunPowerShellScript

    Get-NetFirewallRule -DisplayGroup "Remote Desktop"
    
    

    If rules show Disabled or Block, fix it:

    Enable
    Set
    
    • Reset the built‑in RDP configuration
    
    netsh advfirewall firewall set rule group="remote desktop" new enable=yes
    netsh advfirewall set currentprofile state on
    
    
    • Reset the NIC inside the VM
    ipconfig
    ipconfig
    ipconfig
    

    Restart the NIC:

    Restart-NetAdapter -Name "Ethernet"
    
    • Verify NSG is not auto‑modified

    Go to: Portal → NIC → Effective security rules

    Check if there is a rule coming from:

    • Azure Security Center
    • Firewall Manager
    • Policy Assignment

    If you see unexpected deny rules remove or exclude the policy.****

    • Turn off any Security Baseline or GPO applied by Azure AD / Intune
      Some baselines disable RDP after first sync.

    Check: Portal → Endpoint Manager → Devices → Configuration Profiles

    Disable any Windows Security Baseline temporarily.

    • Enable Boot Diagnostics Screenshot

    Portal → VM → Boot diagnostics

    If the screenshot shows: “Network Level Authentication error”, this is related to TLS or certificate trust.

    reg add "HKLM\System\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" /v UserAuthentication /t REG_DWORD /d 0 /f
    

    The reason RDP works on the first day but not after 24 hours is because something inside the Windows OS is changing — usually the Windows Firewall or a security policy — which begins blocking port 3389. Since Azure Bastion also fails, the issue is inside the VM and not related to public IP or NSG. We can resolve this by re‑enabling the RDP firewall rules and verifying that no policy or security baseline is disabling RDP after the machine is running

    References:
    https://learn.microsoft.com/en-us/troubleshoot/azure/virtual-machines/windows/troubleshoot-rdp-connection


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.