Enabling Remote Desktop in Windows Azure with Visual Studio
Remote Desktop enables you to access the desktop of your Windows Azure Virtual Machines and your Windows Azure Cloud Services. You can use a remote desktop connection to configure the virtual machine or troubleshoot problems with your application.
Note Click to collapse
This article applies to Windows Azure Cloud Services.
For details about connecting to a Windows Azure Virtual Machine using Remote Desktop, see How to long on to a virtual machine.
Accessing the hosting virtual machine for Windows Azure Web Sites is not supported.
Note: Changes made to Windows Azure Cloud Services such as operating system configurations and installing software are not persistent. These changes will be lost if the cloud service is restarted.
The Windows Azure Tools for Visual Studio let you configure Remote Desktop Services for connection to a Cloud Service virtual machine from a Windows Azure project in Visual Studio.
This task includes the following steps:
Step 1: Configure Remote Desktop connections
When you are working on a Windows Azure Cloud Service project in Visual Studio, you have the option of configuring Remote Desktop for the application's role instances, which would allow you to remotely connect to the role instances after the application has been published.
In Visual Studio, open Solution Explorer, right-click the name of your project, and then click Configure Remote Desktop.
The Remote Desktop Configuration dialog box appears.
In the Remote Desktop Configuration dialog box, select the Enable connections for all roles check box.
- Leave the certificate drop-down list value set to Automatic, which means an appropriate certificate from your current certificate store will be automatically selected or a new one will be created if an appropriate one doesn't exist. Alternatively, you can pick a certificate to use or create a new one.
- In the User name, Password, and Confirm password fields, enter the user name and password you want to use to remotely log on to a role instance.
- (Optional) In the Account expiration date field, enter a date for the user account to expire on the role instances.
- Click OK.
Visual Studio then inserts remote desktop settings and certificate details into the service configuration and service definition files for your application.
Step 2: Publish the application
To move the remote desktop settings in your service configuration and service definition files to Windows Azure and to upload the certificate required by Remote Desktop connections, you need to publish the application.
In Solution Explorer, right-click the name of your project, and click Publish.
The Publish Windows Azure Application wizard appears.
On the Windows Azure Publish Sign In page, select the named authentication credentials you want to use, and then click Next.
Need to set up publishing credentials? Click to expand
- On the Windows Azure Publish Sign In page, click the Sign in to download credentials link. You will be prompted to sign in to the Windows Azure Management Portal, and then to download a .publishsettings file.
- Save the .publishsettings file locally.
- Click the Import button and select the .publishsettings file you just downloaded.
- Back on the Windows Azure Publish Sign In page, the subscription associated with the .publishsettings file you just imported will be selected. Click Next to continue.
On the Windows Azure Publish Settings page, select the cloud service to which you want to deploy, the production or staging environment, the build configuration, and the service configuration. Make sure Enable Remote Desktop for all roles is selected, and then click Next.
- On the Windows Azure Publish Summary page, review the settings, and then click Publish.
Visual Studio starts the publishing process of packaging the application and then deploying it to Windows Azure. After several minutes, the deployment is completed.
Step 3: Connect to the role instance
After the application is deployed, you use the Windows Azure Management Portal to initiate the connection to one of the role instances.
- Open the Windows Azure Management Portal.
- In the lower navigation pane of the Management Portal, click Hosted Services, Storage Accounts, & CDN.
- In the upper navigation pane, click Hosted Services. The hosted service in which your newly deployed application is running appears in the portal listed under your subscription.
Under the deployment, select a role instance, and then click Connect.
When prompted to open or save the .rdp file, click Open.
If you receive the Remote Desktop Connection security warning, click Connect.
In the Windows Security dialog box, enter the user name and password that you specified when you configured the Remote Desktop Connection settings in Visual Studio earlier, and then click OK.
The Remote Desktop Connection session opens on the Windows Azure role instance.
Congratulations! You have successfully enabled Remote Desktop Connection for your role instances and can log on to them whenever you need to manage your application on the instance itself.