Search This Blog

Tuesday, November 16, 2010

Remote Desktop Connection to Windows Azure Instance

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:

  1. 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:

    image

    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.
  2. 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.

    image
    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:

  1. Load the Windows Azure Portal and click on Compute, Storage & CDN in the navigation area

    image
  2. 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)

    image
  3. Click on the New Hosted Service button, and you will get the dialog to fill in Hosted Service and Deployment information

    image

    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.
  4. When you fill in all the information click the OK button and you will see your Hosted Service appear below your subscription.

    image
  5. Expand the Compute Services node in the tree and select the Service Certificates node

    image
  6. 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

    image
  7. After it is uploaded you will see your certificate in the grid

    image
  8. 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.

    image
  9. 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? Winking smile We refresh the status every 10 seconds.

    image
    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.

image

 

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.


 

image

 

Voila! You are in!

 

image

 

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:

image

 

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.


Reference: http://blog.toddysm.com/2010/10/remote-desktop-connection-to-windows-azure-instance.html

No comments: