大卫大多数的答案覆盖,具体为什么它的工作原理: 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/
这个答案完全是主题。 –