Failure to connect using RDP or SSH port

Enver Shabani 0 Reputation points
2025-06-04T09:55:04.01+00:00

Since two days ago I was able to connect to my VM directly via RDP, now we are not able to connect any more , we did not do any changes , we have followed all steps and guides on azure portal everything seems to be okay and all diagnostics gives postive result but RDP is not working :).

Is there someone can help on this matter.
Thank you for your support!

kind regards,
Enver

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
9,018 questions
{count} votes

3 answers

Sort by: Most helpful
  1. Abiola Akinbade 29,405 Reputation points Volunteer Moderator
    2025-06-04T12:21:59.7433333+00:00

    Hello Enver Shabani,

    Hmm, this is strange. I would recommend we go through this checklist:

    Please let me know how this goes.

    You can mark it 'Accept Answer' and 'Upvote' if this helped you

    Regards,

    Abiola

    1 person found this answer helpful.
    0 comments No comments

  2. Alex Burlachenko 9,780 Reputation points
    2025-06-04T12:58:27.61+00:00

    hi Enver Shabani,

    I just seen ure having an issue with rdp, if so let's fix it and see if we can get u back in )) even if u didn't change anything, sometimes azure does background updates or network stuff might shift )) so don't worry, we will try figure it out.

    Lets quick checks is the vm running? sounds silly but recheck in the azure portal )) sometimes vms get stopped by accident or auto-shutdown kicks in. is rdp port open? go to the vm's networking settings in azure portal. make sure the rdp port (usually 3389 if u did not change it manually, u didnt?) is allowed in the network security group. if u see a green check but it's still not working, try removing and readding the rule )) weird glitches happen sometimes. nsg rules for rdp. is public ip changed? if u were connecting via public ip and it's dynamic (not static), it might have changed )) check the ip in the azure portal and try connecting to the new one. static ips are better for this exact reason public ip config if all that looks good and it's still not working, lets try that

    • reset the rdp config. in azure portal, go to the vm's serial console and run these commands netsh int ip reset netsh winsock reset then restart the vm. this fixes weird network stack issues
    • check windows firewall on the vm itself. sometimes updates turn it back on. u can disable it temporarily to test

    last resort could be redeploy the vm. this moves it to a new host without deleting anything. go to the vm's "help" section in azure portal and click redeploy. wait 5-10 mins and try again

    hope this helps )) good luck enver!

    Best regards,

    Alex
    and "yes" if you would follow me at Q&A - personaly thx.
    P.S. If my answer help to you, please Accept my answer
    PPS That is my Answer and not a Comment
    

    https://ctrlaltdel.blog/

    1 person found this answer helpful.
    0 comments No comments

  3. Enver Shabani 0 Reputation points
    2025-06-05T05:09:29.22+00:00

    Dear all, Thank you for your support and valuable feedback. All your inputs were relevant and appreciated.

    Restoring the VM from backups or creating a new VM in the same resource group was not a viable solution in this case. I had to follow diagnostic steps to resolve the issue manually.

    The root cause was related to the VMAccessAgent extension.


    For future reference, please see the steps followed to resolve the issue:

    Step 1: Force Delete the Misnamed Extension

    
    az vm extension delete \
      --resource-group <ResourceGroupName> \
      --vm-name <VmName> \
      --name <VmName>
    

    Step 2: Confirm the Extension Was Deleted

    bash
    Copy
    az vm extension list \
      --resource-group <ResourceGroupName> \
      --vm-name <VmName> \
      --output table
    

    Step 3: Install the VMAccessAgent Extension Properly

    
    az vm extension set \
      --resource-group <ResourceGroupName> \
      --vm-name <VmName> \
      --name VMAccessAgent \
      --publisher Microsoft.Compute \
      --version 2.0 \
      --settings "{}"
    

    Step 4: Verify Installation After a Few Minutes

    
    az vm get-instance-view \
      --resource-group <ResourceGroupName> \
      --name <VmName> \
      --query "instanceView.extensions[?name=='VMAccessAgent']" \
      --output table
    

    Expected Output:

    
    Name             ProvisioningState
    ---------------  -------------------
    VMAccessAgent    Succeeded
    

    Let me know if you need any further clarification.

    Best regards, Enver Shabani

    0 comments No comments

Your answer

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