Define and Configure a Remote Desktop Connection
Updated: September 12, 2011
To enable a remote desktop connection for a role, you must add an Import element to the service definition file that imports the RemoteAccess module into the service model. When this module is added to the service definition file, configuration settings are automatically added to the service configuration file. You must add values to these settings to complete the configuration of the remote desktop connection.
Open the ServiceDefinition.csdef file for your hosted service in the text editor.
Note The ServiceDefinition.csdef file is used with the ServiceConfiguration.cscfg file to create a package that is uploaded to Windows Azure. You can locate these files in any folder, but they must be accessible to the Windows Azure SDK Tools. For more information about the ServiceDefinition.csdef file, see Set Up a Cloud Service for Windows Azure. For more information about creating a package for Windows Azure, see Package a Windows Azure Application.
Add the following code to import the RemoteAccess and RemoteForwarder modules:
<Imports> <Import moduleName="RemoteAccess" /> <Import moduleName="RemoteForwarder" /> </Imports>
Save the ServiceDefinition.csdef file.
Open the ServiceConfiguration.cscfg file for your hosted service in the text editor.
When the RemoteAccess module is imported into the service definition, the following configuration settings are automatically added for the role:
<Setting name="Microsoft.WindowsAzure.Plugins.RemoteAccess.Enabled" value="" /> <Setting name="Microsoft.WindowsAzure.Plugins.RemoteAccess.AccountUsername" value="" /> <Setting name="Microsoft.WindowsAzure.Plugins.RemoteAccess.AccountEncryptedPassword" value="" /> <Setting name="Microsoft.WindowsAzure.Plugins.RemoteAccess.AccountExpiration" value="" />
The following elements are added to define the certificate that is used for the remote desktop connection:
<Certificates> <Certificate name="Microsoft.WindowsAzure.Plugins.RemoteAccess.PasswordEncryption" thumbprint="" thumbprintAlgorithm="sha1" /> </Certificates>
When the RemoteForwarder module is imported, the following configuration setting is automatically added for the role:
<Setting name="Microsoft.WindowsAzure.Plugins.RemoteForwarder.Enabled" value="" />
You must define the values for the added configuration settings. The following table lists the settings that are used.
Tip Having trouble viewing this topic in the Windows Azure library? Try viewing it in the MSDN library. Setting name Value
true to enable a remote desktop connection for a role; otherwise, false.
Note To remotely access a role instance, you must set this value to true.
The name of the user account that can access the instance. You must use this account when remotely accessing the role instance.
Note For applications that use a VM role, the user account that you set up for a remote desktop connection is the only account that can be used to access the virtual machine in which the application runs. The Administrator account that is set up when the operating system is installed on the virtual machine is disabled. You cannot use the Administrator account to access the virtual machine.
The encrypted password for the user account. For more information about encrypting the password, see Encrypt a Password by Using the CSEncrypt Command-Line Tool.
The expiration date of the remote desktop connection in ISO 8601 “yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK” format. For example, the expiration date could be "2011-12-17T23:59:59.0000000-08:00".
Add the thumbprint for the certificate. After you upload a hosted service certificate to the Management Portal, you can find the thumbprint for the certificate by clicking the certificate in the center pane and locating the thumbprint in the Properties pane.
true to enable forwarding of remote desktop connection for the service; otherwise, false.
Save the ServiceConfiguration.cscfg file.
You can define the settings and values for a remote desktop connection by using Visual Studio 2010. For more information about doing this, see Using Remote Desktop with Windows Azure Roles.