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:

Remote desktop normally we used to get access to the server physically to do some manipulations as per the requirement. Here the same purpose of to access the role instance on to the server for development purpose only and not for running any windows client on to the server using the Remote session. To enable a Remote session for a Role we need to follow few steps to first Initialize, then configure and later we can connect to the Remote Desktop as we normally do for a server.

[more]

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.

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

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.

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.

Now we are done with our application to check the application locally Hit F5 to build and execute the process and we can see the Build Success as shown in the screen below.

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

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

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

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

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

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 pass we need to follow some specific rules with password should contain a mixture of Upper, lower cases, digits and symbols as shown in the screen below.

Once we gave valid credentials and the Account expiration date your screen looks like below, Click on OK to complete the steps.

Now click on OK to start the publish and we can 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)

Now we are done with creating a certificate and publish 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

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

Now select Personal –> Certificates and we can 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.

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

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

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

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

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

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.

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

Now we are done with the process of creating a certificate, exporting the certificate to a file and created the service file and the package of the application roles.

Now login to the management portal using the below link

http://www.microsoft.com/windowsazure/

We can 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 below screen

Once we gave the correct credentials and click on submit button will navigate to the main screen of the portal as shown in the below 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.

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.

Once we gave valid credentials along with the environment and the package files we can see the application will be created as shown in the below screen.

First the Hosted Service is created

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

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

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

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

Now add the certificate which 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

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

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

Once the process gets completed we can see a new certificate has been created successfully as shown in the screen below

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

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.

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 on OK button to process the configuration as shown in the screen below

Now we can see the configuration process takes place as shown in the screen below.

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

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

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

Now we can see file (Remote desktop file .rdp ) will be prompted to save in the local drive, save it an accessible location as shown in the screen below.

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

Clicking on 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 on OK button to proceed further

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

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

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

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

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

Author

Karthikeyan Anbarasan, Microsoft MVP (Most Valuable Professional) in ASP.NET/IIS Architecture. He is the Founder and Chief Editor of the www.f5debug.net website and has authored books on Windows Phone and Business Intelligence(SSIS). He is also a Passionate Speaker and a Blogger on Microsoft Technologies.

Site Counter

Awards

Disclaimer

This is a personal weblog. The opinions expressed here represent my own and not those of my employer. For accuracy and official reference refer to MSDN/ TechNet. I have documented my personal experience on this blog.