Enabling Remote Desktop in Azure

1 min to read Contributors

Remote Desktop enables you to access the desktop of a role instance running in Azure. You can use a remote desktop connection to configure the virtual machine or troubleshoot problems with your application.

Note

This article applies to Node.js applications hosted as an Azure Cloud Service.

Prerequisites

Step 1: Use Azure PowerShell to configure the service for Remote Desktop access

To use Remote Desktop, you need to update the Azure service definition and configuration with a username, password, and certificate.

Perform the following steps from a computer that contains the source files for your app.

  1. Run Windows PowerShell as Administrator. (From the Start Menu or Start Screen, search for Windows PowerShell.)
  2. Navigate to the directory that contains the service definition (.csdef) and service configuration (.cscfg) files.
  3. Enter the following PowerShell cmdlet:

     Enable-AzureServiceProjectRemoteDesktop
    
  4. At the prompt, enter a user name and password.

    enable-azureserviceprojectremotedesktop

  5. Enter the following PowerShell cmdlet to publish the changes:

    Publish-AzureServiceProject
    

    publish-azureserviceproject

Step 2: Connect to the role instance

After you publish the update service definition, you can connect to the role instance.

  1. In the Azure classic portal, select Cloud Services and then select your service.

    Azure classic portal

  2. Click Instances, and then click Production or Staging to see the instances for your service. Select an instance and then click Connect at the bottom of the page.

    The instances page

  3. When you click Connect, the web browser prompts you to save an .rdp file. Open this file. (For example, if you're using Internet Explorer, click Open.)

    prompt to open or save the .rdp file

  4. When the file is opened, the following security prompt appears:

    Windows security prompt

  5. Click Connect, and a security prompt will appear for entering credentials to access the instance. Enter the password you created in [Step 1][Step 1: Configure the service for Remote Desktop access using Azure PowerShell], and then click OK.

    username/password prompt

When the connection is made, Remote Desktop Connection displays the desktop of the instance in Azure.

Remote desktop session

Step 3: Configure the service to disable Remote Desktop access

When you no longer require remote desktop connections to the role instances in the cloud, disable remote desktop access using Azure PowerShell.

  1. Enter the following PowerShell cmdlet:

    Disable-AzureServiceProjectRemoteDesktop
    
  2. Enter the following PowerShell cmdlet to publish the changes:

    Publish-AzureServiceProject
    

Additional Resources