Hello, @Anurag Pandey ! It's odd that you've been able to connect to a VM and that stops working after a period of time on multiple VMs. That makes me wonder if the workload is either too much for the VM or if the VM state is becoming compromised (a hung task, for example). There are a lot of troubleshooting options, which I'll list below.
How do I troubleshoot scenarios where I can't connect to my VM?
I would second @Wesley Li and also recommend going through the VM troubleshooting guide for RDP connections:
https://learn.microsoft.com/en-us/troubleshoot/azure/virtual-machines/troubleshoot-rdp-connection
Quick troubleshooting steps After each troubleshooting step, try reconnecting to the VM:
- Reset Remote Desktop configuration.
- Check Network Security Group rules / Cloud Services endpoints.
- Review VM console logs.
- Reset the NIC for the VM.
- Check the VM Resource Health.
- Reset your VM password.
- Restart your VM.
- Redeploy your VM.
I would also look at your VM performance and analyze workloads to see if there is something that is causing your VM to hang. If you are still having issues after completing the troubleshooting, let us know in the comments as we may need to take a closer look at your resources.
I hope this has been helpful! Your feedback is important so please take a moment to accept answers.
If you still have questions, please let us know what is needed in the comments so the question can be answered. Thank you for helping to improve Microsoft Q&A!