Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/azure/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
了解Azure云服务防火墙_Azure_Azure Web Roles_Azure Worker Roles_Azure Cloud Services - Fatal编程技术网

了解Azure云服务防火墙

了解Azure云服务防火墙,azure,azure-web-roles,azure-worker-roles,azure-cloud-services,Azure,Azure Web Roles,Azure Worker Roles,Azure Cloud Services,我试图理解默认情况下Azure云服务(Web/工作者角色)的防火墙规则是什么,我感到困惑 基于多个源(包括此链接),默认情况下,云服务的入站连接被阻止,无论是it工作者角色还是web角色。要打开入站连接,我需要为.cscfg中的端点元素指定参数 然而,我从来没有这样做过,但是我的web角色和工作者角色接受内置连接,甚至UDP连接到工作者角色 我错过了什么 更新:很抱歉,我看错了文件。由于无法解释的原因,我混合了.csdef和.cscfg。现在它看起来像一个愚蠢的问题:)你说得对-web和work

我试图理解默认情况下Azure云服务(Web/工作者角色)的防火墙规则是什么,我感到困惑

基于多个源(包括此链接),默认情况下,云服务的入站连接被阻止,无论是it工作者角色还是web角色。要打开入站连接,我需要为.cscfg中的
端点
元素指定参数

然而,我从来没有这样做过,但是我的web角色和工作者角色接受内置连接,甚至UDP连接到工作者角色

我错过了什么


更新:很抱歉,我看错了文件。由于无法解释的原因,我混合了.csdef和.cscfg。现在它看起来像一个愚蠢的问题:)

你说得对-web和worker角色需要定义端点,以允许外部通信通过到你的角色实例

关于您当前可以访问现有web/worker实例的事实:默认情况下,会为您的web角色创建端口80的端点,如果启用了RDP,也会启用该端点

请注意,存在端口映射:也就是说,指定外部端口(可能是…端口8000),然后映射到代码正在侦听的实际端口(可能是…端口80)

另外,请注意,如果您将其中一个端口用于一个角色,则必须为不同的角色提供不同的端口。给定角色的所有实例都可能以负载平衡的方式使用相同的端口。但是如果您在web角色的外部使用端口8000设置web服务器,并且您定义了另一个web角色(或者可能是工作者角色),则无法将端口8000用于该角色


角色终结点在Visual Studio中的云服务项目中公开,以防您不想直接编辑配置文件。

David提供了大部分答案,详细介绍了其工作原理:

看看csdef文件,其中有一个导入部分

<Imports>
  <Import moduleName="<import-module>"/>
</Imports>
导入此模块会导致在运行时将以下配置添加到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>

这将为RDP连接打开端口3389,因此端点位于.csdef文件中,但通过导入

再看一下“RemoteForwarder”,它充当网关,因此只有1个端口(3389)必须在外部打开,只有1个实例将侦听此消息。然后,RemoteForwarder将RDP连接转发到正确的机器。更多信息:

这个答案完全离题了。
<?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>