AZ RDP to Machine
    • Dark
      Light
    • PDF

    AZ RDP to Machine

    • Dark
      Light
    • PDF

    Article Summary

    Short description

    Opens a remote desktop session to an Azure virtual machine.

    Detailed description

    The script checks the network security group associated with the Azure virtual machine that you select in the Real-Time Console. The script will establish a successful RDP connection if:

    • TCP Port 3389 is set to Allow.
      image.png

    • TCP Port 3389 is set to Deny, but the Service Principal you created for ControlUp has the permission to create a new rule. In this case, the script will automatically create a new rule for the time of the connection.
      4_AddNewRuleToNSG

    Prerequisites

    The Network Security Group (NSG) of the virtual machine must allow incoming RDP traffic, either by explicitly opening port TCP port 3389 or by allowing your Service Principal to create a new rule in the NSG. The script retrieves the external IP that is needed for the custom rules from http://ipinfo.io/ip. Verify that the console machine is configured to accept traffic to this URL.

    Important

    As a best practice, never expose management endpoints like RDP over a public IP address. Connect via a private network instead (Site-to-Site or Point-to-Site connection).

    How to use

    1. Execute the AZ RDP to machine script on the Azure virtual machine you want to connect remotely.

    2. The RDP login window is shown if the RDP Port and the external IP of the machine are reachable. Log in with a user with logon permissions.
      image.png

    3. You can now manage the Azure virtual machine remotely.
      6_RDPSessionTemplate

    4. When you disconnect the session, the verbose output of the script is displayed in the Output tab. In our example, we have set the RDP rule in the Azure Portal to Deny. The script temporarily created a new rule that allowed us to connect to the Azure virtual machine from our public IP address.
      5_AddNewRuleToNSGInConsole


    Was this article helpful?