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
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 will see the message saying that the build was successful as shown in the screen below.
Once the execution is completed with the packaging we will 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 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.
After providing valid credentials and the Account expiration date your screen looks like the following, click on OK to complete the steps.
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):
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:
A new window will be opened with the grouped list of certificates installed on the computer as shown in the screen below.
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.
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.
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 the 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 the 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 to complete the process and we will 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 creating the service file and the package of the application roles.
Now login to the Management Portal using the following link:
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.
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.
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.
We will 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 will see the status as shown below.
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.
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.
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.
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.
We will see the status of creating the certificate as shown in the screen below:
Once the process has completed we will see that a new certificate has been created successfully as shown in the screen below:
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.
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 the OK button to process the configuration as shown in the screen below:
Now we will see the configuration process taking place as shown in the screen below.
We will see the Roles and instances of the application geting updated in the Status message as shown in the screen below.
Once the update has completed we will see now the Roles and Instance are ready as shown in the screen below.
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.
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.
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.
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.
Now a warning will be prompted, just ignore that warning and click on yes to proceed further as shown in the screen below.
We will see the secure connection to the remote server is made and we will 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 will 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