How to solve this issue?
Issue: The target machine has denied access to this connection. If you require access, please grant access to your account on the target machine, or check your system settings.
I tried to create azure virtual machine by using bastion connection by disabling the public ports. I am getting the OS image screenshot in boot diagnostics but i am unable to connect using bastion it is showing the error in image? Thank you!
The target machine has denied access to this connection. If you require access, please grant access to your account on the target machine or check your system settings.
This error occurs due to multiple reasons like if the user account trying to connect do not have the required permissions to access the machine.
Make sure to assign the user Reader role
on the virtual machine, the NIC with the private IP of the virtual machine. refer this MSDoc
In my case when I added NSG inbound rule 3389 configured to allow bastion its connected:
In vm -> run command -> SetRDPPort
-> Run
Now bastion connected successfully:
References:
Quickstart: Deploy Bastion with default settings - Azure Bastion | Microsoft Learn