大衛大多數的答案覆蓋,具體爲什麼它的工作原理: https://azure.microsoft.com/nl-nl/documentation/articles/cloud-services-role-enable-remote-desktop/
看看在csdef文件中,有在那裏
<Imports>
<Import moduleName="<import-module>"/>
</Imports>
了該模塊的導入部分RDP是「RemoteAccess」,並且會有一個「RemoteAccessForwarder」,所有插件/模塊都位於此目錄中的Azure SDK中(用您的azure SDK版本替換v2.9)
C:\Program Files\Microsoft SDKs\Azure\.NET SDK\v2.9\bin\plugins
導入下面的配置此模塊的結果被添加到csdef文件在運行時:
<?xml version="1.0" ?>
<RoleModule
xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition"
namespace="Microsoft.WindowsAzure.Plugins.RemoteAccess">
<Startup priority="-1">
<Task commandLine="RemoteAccessAgent.exe" executionContext="elevated" taskType="background" />
<Task commandLine="RemoteAccessAgent.exe /blockStartup" executionContext="elevated" taskType="simple" />
</Startup>
<ConfigurationSettings>
<Setting name="Enabled" />
<Setting name="AccountUsername" />
<Setting name="AccountEncryptedPassword" />
<Setting name="AccountExpiration" />
</ConfigurationSettings>
<Endpoints>
<InternalEndpoint name="Rdp" protocol="tcp" port="3389" />
</Endpoints>
<Certificates>
<Certificate name="PasswordEncryption" storeLocation="LocalMachine" storeName="My" permissionLevel="elevated" />
</Certificates>
</RoleModule>
這將打開3389端口用於RDP連接,所以端點處於.csdef文件,但通過導入。
另外看看「RemoteForwarder」,它充當網關,所以只有1個端口(3389)必須在外部打開,並且只有1個實例會聽到這個。 RemoteForwarder然後將RDP連接轉發到正確的機器。更多信息: https://blogs.msdn.microsoft.com/avkashchauhan/2011/12/06/how-does-remote-desktop-works-in-windows-azure/
這個答案完全是主題。 –