Remote Desktop Connection to Windows Azure Instance
It has been long time since my last post related to Windows Azure. We have been concentrated on delivering all the new and exciting features for PDC2010, and of course we wanted to keep them secret.
In this morning’s PDC2010 keynote Bob Muglia revealed the secret, and I would like to start with my favorite feature – establish Remote Desktop connection to any Windows Azure instance. Here is the step-by-step guide how to enable the feature, and how to use it.
Configuring Windows Azure Deployment for RDP
The first thing I did is to create new basic Cloud Project in Visual Studio. I called it Hello RDP. Nothing new here. I modified the Default.aspx page just to make it say: “Hello, RDP!”.
Here are the steps (quite simple) that you need to go through to enable Remote Desktop in your deployment:
- In Visual Studio right-click on the Cloud Project (Hello RDP in my case) and select Publish. You will be presented with the Deploy Windows Azure project dialog below:
I have selected the Create Service Package Only option but you have the choice to deploy from Visual Studio to the cloud directly if you want.
- Next click on the link Configure Remote Desktop connection above the OK button. You will see the Remote Desktop Configuration dialog where you can select the certificate you want to use to encrypt the credentials as well as the actual credentials you want to use to login to the instance and the expiration date for the password.
In the Certificates drop down you can select a certificate from your local cert store or create a new one that will be sored locally. After you fill in all the information click on the OK button in the current dialog as well as in the deployment dialog.
Your package will be created on the local hard drive.
Note: If you do not have Hosted Service created and/or if you don’t have the certificate already uploaded through the Windows Azure Portal you should create the package locally and deploy it through the Portal. See next section for more details.
Configuring the Windows Azure Hosted Service
In the current implementation (as of PDC10) you need to create hosted service and upload the certificate before you do the deployment. There may be some changes for the official release of the new UI in order to make it more streamlined. Here is the current workflow:
- Load the Windows Azure Portal and click on Compute, Storage & CDN in the navigation area
- Click on the Compute Services node in the tree. In the grid you will see your subscription (or subscriptions if you have more than one)
- Click on the New Hosted Service button, and you will get the dialog to fill in Hosted Service and Deployment information
In the new Windows Azure Portal UI we combined the creation of Hosted Service and the Deployment in one step. However for RDP you should choose the “Do not deploy” option because you will receive error if you don’t have the certificate uploaded.
- When you fill in all the information click the OK button and you will see your Hosted Service appear below your subscription.
- Expand the Compute Services node in the tree and select the Service Certificates node
- Click on Add Certificate to open the Upload Certificate dialog. Select the same certificate that you selected in the Visual Studio dialog when configuring your package, and click the Create button.
Note: Make sure you select the right Hosted Service in the Target Hosted Service dialog
- After it is uploaded you will see your certificate in the grid
- Go back to the Compute Services view and click on New Production Deployment (or New Staging Deployment if you want to deploy to staging). Create a new Deployment dialog will appear where you can select the package and the configuration file you created in visual studio above.
- After clicking OK you will see new line item in the grid that represents your deployment. In addition you will receive frequent updates what is happening with the deployment, and it will expand once the roles and instances are spun up. Really cute – isn’t it? We refresh the status every 10 seconds.
Now, you just need to wait until your deployment is complete.
Connecting to the Windows Azure Instance
Once the deployment is complete the instances will be in Ready state, and when you select any one of them the Remote Desktop Connect button in the ribbon will light up.
When you click the Connect button you will be asked to download RDP file from the Windows Azure Portal (Note: Silverlight will also present you with security warning the first time you click on the Remote Access Connect button; you can select the checkbox in the warning if you don’t want to be warned in the future). You can select Open in the prompt for downloading the RDP file and the connection to the Windows Azure Instance will be established. Optionally you can save the RDP file locally for future use.
Voila! You are in!
Finally, it is highly recommended that you turn off Remote Desktop access to your Windows Azure instances when you don’t need it in order to avoid security risks. You can do this very easily from the Portal – just select the Role row, and uncheck the Remote Access Enabled checkbox:
Final Notes and Disclaimers About the Remote Desktop Feature
Couple of things I would like to mention at the end:
- First, the Remote Desktop feature is scheduled to be released at the end of the year, which means we are still working on it and there may be some changes in the workflow
- And second, the new Windows Azure Portal UI is also scheduled to release at the end of November and there may be some changes in the UI also. I have used the environment we use for the PDC demos to make the screenshots above, and if you are attending the conference you will see the same UI in the hands-on labs
I will try to update this blog post with any changes we make between PDC and the final release.
Hope you enjoy the new features in Windows Azure, and as always your feedback is highly appreciated.
Update (March 30th 2011) – Troubleshooting Remote Desktop Connectivity Issues
If you are experiencing issues establishing remote desktop connection to your Windows Azure instance you may want to check the RDP file that is downloaded from Windows Azure Management Portal. Here is what you need to do:
- Click on Connect button in Windows Azure Management Portal
- Save the RDP file on your local machine
- Open the RDP file with Notepad and verify the following
In some occasions
part will be missing and this will prevent you from establishing remote connection to your Windows Azure instance. Add the necessary information to the RDP file and save it.
You can get the
role_name and the
instance_name from the Management Portal