Azure Service Fabric - 无法删除任何默认 NAT 规则

标签 azure azure-service-fabric

我需要阻止对 RDP 的访问,但似乎没有办法做到这一点,我要么收到错误的“成功”消息并且规则仍然存在,要么出现下面的错误

Failed to delete inbound NAT rule 'LoadBalancerBEAddressNatPool.0'. Error: Adding or updating NAT Rules when NAT pool is present on loadbalancer /subscriptions/... is not supported. To modify the load balancer, pass in all NAT rules unchanged or remove the LoadBalancerInboundNatRules property from your PUT request.

最佳答案

在基于 ARM 模板的方法中,我必须删除 loadBalancingRules 中的 inboundNatPools

    // "inboundNatPools": [
    //   {
    //     "name": "LoadBalancerBEAddressNatPool",
    //     "properties": {
    //       "backendPort": "3389",
    //       "frontendIPConfiguration": {
    //         "id": "[variables('lbIPConfig0')]"
    //       },
    //       "frontendPortRangeEnd": "4500",
    //       "frontendPortRangeStart": "3389",
    //       "protocol": "tcp"
    //     }
    //   }
    // ]
VMSS

networkProfile 中的

loadBalancerInboundNatPools

      "networkProfile": {
        "networkInterfaceConfigurations": [
          {
            "name": "[concat(parameters('nicName'), '-0')]",
            "properties": {
              "ipConfigurations": [
                {
                  "name": "[concat(parameters('nicName'),'-',0)]",
                  "properties": {
                    "loadBalancerBackendAddressPools": [
                      {
                        "id": "[variables('lbPoolID0')]"
                      }
                    ],
                    // "loadBalancerInboundNatPools": [
                    //   {
                    //     "id": "[variables('lbNatPoolID0')]"
                    //   }
                    // ],
                    "subnet": {
                      "id": "[variables('subnet0Ref')]"
                    }
                  }
                }
              ],
              "primary": true
            }
          }
        ]
      },

然后再次部署。

对于您来说,这意味着使用资源组中的自动化功能提取 ARM 模板,删除上述条目,然后再次部署。

关于Azure Service Fabric - 无法删除任何默认 NAT 规则,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46966447/

相关文章:

azure - MS Azure 自动缩放 - 无法识别 react 规则的目标

azure - 在 Service Fabric 中,SetupEntryPoint 是否在所有节点上执行?

azure-service-fabric - VS2017 中的服务结构工具似乎已损坏

azure - 在 Service Fabric 集群上发布应用程序后 HttpContext.Session 为空

azure-service-fabric - 服务结构和 IPv4

azure - ARM REST API 中的多个资源过滤器

azure - 将节点添加到 Service Fabric 群集

azure - 如何引用使用矩阵策略的azure管道作业的输出变量?

azure - 从 Internet 访问 Service Fabric

c# - 多个 kestrel 无状态服务实例在服务结构中的不同端口上运行