If you are connecting through an RD Gateway:
💡 Always verify that your server is using the correct IPv4 address if you are connecting over a WAN, as IP changes can trigger generic 0x904 errors. If you'd like to dive deeper, let me know: Are you connecting via a VPN ? Is this a home PC or a Windows Server environment? Did this start after a Windows Update ? Share public link
From the Azure Portal, go to your VM and select Run Command , then choose RunPowerShellScript . If you are connecting through an RD Gateway:
Here is a summary of the best troubleshooting steps compiled from expert blog posts and technical forums: 1. Fix Expired RDP Certificates (Most Common Solution)
Add C:\Windows\System32\mstsc.exe to your antivirus/firewall exclusion list. Phase 4: Azure VM Specific Fix Did this start after a Windows Update
: Windows Defender or third-party security software (like Bitdefender) blocking the RDP executable.
To avoid running into error 0x904 or similar connection drops in the future, implement these quick network optimizations: Fix Expired RDP Certificates (Most Common Solution) Add
Modify NLA settings via the Group Policy Editor ( gpedit.msc ) under settings for Remote Desktop Services if compatibility issues are suspected. Unable to RDP into some Windows Servers - Error code: 0x904
Here is the step-by-step guide to troubleshooting and fixing this error.
Ensure or Remote Desktop Services has "Read" permissions. Restart the Remote Desktop Services via services.msc . 2. Disable Network Level Authentication (NLA)