Windows Azure - Configure & Connect to Remote Desktop of ASP.Net Azure Web Role

Introduction:

In this article we are going to see how to configure and connect a Remote Desktop of ASP.Net Azure Web Role by creating a new Azure web application and initializing the process.

Overview:

We normally use a Remote Desktop to get access to the server physically to do some manipulations as per the requirement. Here the same purpose of accessing the role instance on the server for development purposes only and not for running any windows client on the server using the remote session. To enable a Remote session for a Role we need to follow a few steps to first initialize, then configure and later we can connect to the Remote Desktop as we normally do for a server. Lets us see the step by step process of how to create a new role and add the Remote Desktop access and configure it on the server using the Windows Azure Management Portal.

Steps:

Open Visual Studio 2010-> File-> New Project and navigate to the Cloud tab at the left and select Windows Azure Project and change the name of the project to RemoteDesktopSample as shown in the screen below.

Note - check my previous article for clear steps of how to create a new Azure application and hosting it to the cloud

image_thumb2

Now a pop up window opens to select the Role from the list of roles available as shown in the screen below:

image_thumb3

Since we are going to create a sample we go with ASP.Net Web Role, select the Role and click on the > button to select the role as shown in the screen below.

image_thumb4

Clicking on OK button will open a new project with some inbuilt structures as shown in the screen below. Do some modifications as shown in the screen below to host the application to the cloud and check for the result.

image_thumb5

Now we are done with our application to check the application locally. Hit F5 to build and execute the process and we will see the message saying that the build was successful as shown in the screen below.

666.png

Once the execution is completed with the packaging we will see the application available locally as shown in the screen below.

66.png

Now in order to activate the Remote Desktop session, right-click the Azure application and click on Publish as shown in the screen below.

image

We will see a pop up window with the 2 different options (check my previous articles to get indepth knowledge of the options). Click on the "Configure Remote Desktop Connections…" as shown in the screen below:

image

Click on the "Enable Connections for all roles" check box and select the Create or Select certificate option drop down and select already existing certificate or click on Create as shown in the screen below:

image

Now we will get a pop up asking for a friendly name; we can give any name for the certificate as per our wish as shown in the screen below. Here we have given it as f5Debug to have it handy:

image

Clicking on the OK button after giving a desired name, we need to enter a user name and password that will be used for connecting remotely. For the password we need to follow some specific rules; the password should contain a mixture of upper and lower cases, digits and symbols as shown in the screen below.

image 

After providing valid credentials and the Account expiration date your screen looks like the following, click on OK to complete the steps.

image

Now click on OK to start publishing and we will see the configuration file and package created as shown in the screen below (check my previous articles on the usage of these files in detail):

image

Now we are done with creating a certificate and publishing files (service and config files). In order to get the certificate we need to follow some steps.

Note - check my previous article on how to create a certificate and export it in details using the link.

To get the certificate, click on Start –> Run and type certmgr.msc as shown in the screen below:

image

A new window will be opened with the grouped list of certificates installed on the computer as shown in the screen below.

image

Now select Personal –> Certificates and we will see the list of personal certificates created on the server. Select the certificate which we created for this sample(f5Debug friendly name) as shown in the screen below.

image

Double-click the certificate; a window will open; navigate to the Details tab and click on Copy to File as shown in the screen below.

image

A wizard will open to export the certificate as shown in the screen below.

image

Click on Next to start the wizard and select Yes, export the private key and click on the next button as shown below:

image

Now select Personal Information Exchange and click on Next button as shown below:

image

Enter the password for the certificate as shown in the screen below and click on the Next button.

image

Now it will prompt for the path to save the certificate .pfx file, navigate to a user friendly path and select it as shown in the screen below.

image

Clicking on next will provide a summary for the export, now click on Finish to complete the process and we will see a message that the export was successful as shown in the screen below.

image

Now we are done with the process of creating a certificate, exporting the certificate to a file and creating the service file and the package of the application roles.
Now login to the Management Portal using the following link:

http://www.microsoft.com/windowsazure/
We will see a screen like below. Select the Sign into Management Portal at the top right corner.



After selecting that sign in to Management Portal you will be asked for the Username and Password to authenticate the process as shown in the following screen:



After providing the correct credentials and clicking on the submit button it will navigate to the main screen of the portal as shown in the following screen:



Now click on the Hosted Services, Storage Account and CDN option in the bottom menu and then select the Hosted Services as shown in the screen below.

2011-07-12 06h52_37_thumb_thumb_thumb

Click on the New hosted service and create a service as shown below.

Note - Check my previous article on how to create a hosted service in detail.

2011-07-14 09h04_04

After providing valid credentials along with the environment and the package files we will see the application is created as shown in the below screen.
First the Hosted Service is created.

2011-07-14 09h18_56

We will see the status of the hosted service creation step by step in the status column as shown below.

2011-07-14 09h20_51

Now once the service is created, the new application will be created and we will see the status as shown below.

2011-07-14 09h21_42

We will see the hosted service role, instance has been created with the different steps like below (Waiting for Host, Creating Host, Starting Host) as shown in the screens below.

2011-07-14 09h22_57

2011-07-14 09h23_31

2011-07-14 09h24_16

Once those steps are done, we will see the service, application roles and instances are created and the status is Ready which indicates that we can use the application online as shown in the screen below.

2011-07-14 09h29_12

Now add the certificate we created to the hosted service as shown in the screen below. Click on Add Certificate.

Note - Check my previous article on how to add the certificate in detail.

image

Select the certificate path and provide the password which we gave while exporting the certificate as shown in the screen below and click on the create button.

image

We will see the status of creating the certificate as shown in the screen below:

image

Once the process has completed we will see that a new certificate has been created successfully as shown in the screen below:

image

Now click on the Role and we will see the Enable and Configure buttons in the Top Ribbon Menu enabled as shown in the screen below.

image

Click on the Enable Checkbox and click on Configure to configure the Remote Desktop steps, we will get a pop up screen as shown below.

image

Enter the valid credentials of username and password, note that the password is enforced with some rules. Providing valid credentials will allow us to proceed further. Now click the OK button to process the configuration as shown in the screen below:

image

Now we will see the configuration process taking place as shown in the screen below.

image

We will see the Roles and instances of the application geting updated in the Status message as shown in the screen below.

image

Once the update has completed we will see now the Roles and Instance are ready as shown in the screen below.

image

Now we will see the Connect Button on the top ribbon menu enabled. Click on the Connect button to proceed further as shown in the screen below.

image

Now we will see a prompt to save the file (Remote Desktop file .rdp) in the local drive; save it in an accessible location as shown in the screen below.

image

Now double-click the file to open a window asking to connect to the server. We will see the server name (remote computer) as shown in the screen below. Click the Connect button to proceed further.

image

Clicking the Connect button will open a security window asking to enter the user name and password to authorize the account. Provide the username and password which we gave at the time of configuration as shown in the screen below and click the OK button to proceed further.

image

Now a warning will be prompted, just ignore that warning and click on yes to proceed further as shown in the screen below.

image

We will see the secure connection to the remote server is made and we will see the status as shown in the screen below.

image

Finally we will be logged into the Remote server of the role as shown in the screen below. Also we will see that the server is Windows Server 2008 Enterprise which is not a genuine.

2011-07-15 09h39_22

Now we can use the Remote server as a normal server which we use it traditionally as shown in the screen below.

2011-07-15 09h47_53

Conclusion:

So in this article we have seen the step step process of how to configure the Remote Desktop connection for each and every role and connect to the specified server


Similar Articles