Share via

Unable to Connect to Azure VM After Signing In with AAD Credentials

Yanxia Xu 0 Reputation points Microsoft Employee
2026-02-06T07:53:10.23+00:00

Cannot Connect to Azure VM After AAD Login

Repro Steps:

  1. Provisioned an Azure VM with AAD login enabled.
  2. Added the VM as a Microsoft‑managed device.
  3. Logged into the VM successfully using an AAD account.
  4. After a few minutes, the connection was interrupted.
  5. Afterwards, I could no longer reconnect to the VM
Azure Virtual Machines
Azure Virtual Machines

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

{count} votes

2 answers

Sort by: Most helpful
  1. Nikhil Duserla 9,685 Reputation points Microsoft External Staff Moderator
    2026-02-25T19:06:25.22+00:00

    Hello @Yanxia Xu ,

    Thank you for connecting with me on the call. As observed, the issue occurs when attempting to access the remote system, and the following error message is displayed:

    “This computer can’t connect to the remote computer. Try connecting again. If the problem continues, contact the owner of the remote computer or your network administrator.”

    User's image

    Go to the Configuration settings of the virtual machine and check the Security type. It should be set to Standard. If it is currently set to Trusted Launch, please change it to Standard.

    Check that you are able to access the remote computer over the network and that the RDP port (TCP 3389) is responding. Check connectivity to the RDP host using PowerShell: Test-NetConnection rdp_server_name1 -Port 3389 -InformationLevel Quiet

    If this command returns False, then the RDP port on the server RDP port isn’t responding, it may be blocked by a firewall, or it may not be listened to by the remote host.

    To connect to the VM remotely using the tools discussed in this link- https://learn.microsoft.com/en-us/troubleshoot/azure/virtual-machines/windows/remote-tools-troubleshoot-azure-vm-issues, you must first configure the client computer to allow the connection.

    Please follow the scenarios outlined in this link to help identify the cause of the issue and determine the appropriate solution- https://learn.microsoft.com/en-us/troubleshoot/azure/virtual-machines/windows/event-id-troubleshoot-vm-rdp-connecton#scenario-1

    Note: This guide provides clear examples and step-by-step troubleshooting instructions to help you understand the process more effectively. As we are from Microsoft, we don’t rely on third-party links for validation; this resource is shared purely for your reference and clarity- https://theitbros.com/this-computer-cant-connect-to-the-remote-computer/

    Please let me know if you need any further assistance. I’d be happy to help. The above solution might help you.

    0 comments No comments

  2. SUNOJ KUMAR YELURU 17,981 Reputation points MVP Volunteer Moderator
    2026-02-06T14:14:58.76+00:00

    Hello @Yanxia Xu,

    Thanks for using Q and A forum.

    If you are unable to reconnect to your Azure VM after an AAD login, it could be due to several reasons. Here are some troubleshooting steps you can follow:

    1. Check Security Policies: Ensure that the security policy Network security: Allow PKU2U authentication requests to this computer to use online identities is enabled on both the server and the client. This setting is crucial for AAD authentication to work correctly.
    2. Connection Issues: If the connection was interrupted, it might be due to network issues or misconfiguration. Ensure that your local network equipment is not blocking outbound TCP port 3389, which is used for RDP connections. You can review the Network Security Group (NSG) rules associated with your VM to ensure that RDP is allowed.
    3. Profile Issues: If the user profile has issues, it may prevent successful logins. You can use the Azure Serial Console to check for any profiles with a “.bak” extension and remove them if necessary. This can be done by connecting to the VM using the Serial Console and running specific PowerShell commands.
    4. Access Denied Errors: If you encounter access denied errors, check the permissions for the Remote Desktop Users group and ensure they have the necessary access rights. You may need to adjust registry settings to resolve these issues.

    By following these steps, you should be able to diagnose and potentially resolve the issue preventing you from reconnecting to your Azure VM after an AAD login.


    If this answers your query, do click Accept Answer and Up-Vote for the same. And, if you have any further query do let us know.

    0 comments No 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.