Поделиться через


Включение безопасного подключения к кластеру

В этой статье объясняется, как использовать безопасное подключение к кластеру для рабочих областей Azure Databricks. Безопасное подключение к кластеру также называется отсутствием общедоступного IP-адреса (NPIP). Хотя бессерверная плоскость вычислений не использует безопасное подключение к кластеру, бессерверные вычислительные ресурсы не имеют общедоступных IP-адресов.

Общие сведения о защищенном подключении к кластеру

When secure cluster connectivity is enabled, customer virtual networks have no open ports and compute resources in the classic compute plane have no public IP addresses.

  • Each cluster initiates a connection to the control plane secure cluster connectivity relay during cluster creation. Кластер устанавливает это подключение с помощью порта 443 (HTTPS) и использует другой IP-адрес, отличный от используемого для веб-приложения и REST API.
  • Когда плоскость управления выполняет задачи администрирования кластера, эти запросы отправляются в кластер через этот туннель.

Note

All Azure Databricks network traffic between the classic compute plane VNet and the Azure Databricks control plane goes across the Microsoft network backbone, not the public internet. This is true even if secure cluster connectivity is disabled.

Вы можете включить безопасное подключение к кластеру в новой рабочей области или добавить его в существующую рабочую область, уже использующую внедрение виртуальной сети .

Включение безопасного подключения к кластеру в новой рабочей области

Secure cluster connectivity is automatically enabled when you create a workspace using the Azure portal or an Azure Resource Manager (ARM) template.

Add secure cluster connectivity to an existing workspace

You can enable secure cluster connectivity on an existing workspace using the Azure portal, an ARM template, or azurerm Terraform provider version 3.41.0+. The upgrade requires that the workspace uses VNet injection.

Important

Если вы используете брандмауэр или другие изменения конфигурации сети для управления входящего трафика или исходящего трафика из классической вычислительной плоскости, может потребоваться обновить правила брандмауэра или группы безопасности сети одновременно, чтобы эти изменения вступили в силу. Например, при использовании безопасного подключения к кластеру существует дополнительное исходящее подключение к плоскости управления, а входящие подключения из плоскости управления больше не используются.

Step 1: Stop all compute resources

Остановите все классические вычислительные ресурсы, такие как кластеры, пулы или классические хранилища SQL. Databricks recommends planning the timing of the upgrade for down time.

шаг 2. Обновление рабочей области

Вы можете обновить рабочую область с помощью портала Azure, шаблона ARM или Terraform.

Использование портала Azure

  1. Перейдите в рабочую область Azure Databricks на портале Azure.
  2. In the left navigation under Settings, click Networking.
  3. In the Network access tab, set Deploy Azure Databricks workspace with Secure Cluster Connectivity (No Public IP) to Enabled.
  4. Click Save.

Обновление сети может занять более 15 минут.

Apply an updated ARM template using Azure portal

Используйте шаблон ARM, чтобы установить значение параметра enableNoPublicIp в True (true).

Note

If your managed resource group has a custom name, you must modify the template accordingly. Contact your Azure Databricks account team for more information.

  1. Copy the following upgrade ARM template JSON:

    {
      "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
      "contentVersion": "1.0.0.0",
      "parameters": {
        "location": {
          "defaultValue": "[resourceGroup().location]",
          "type": "String",
          "metadata": {
            "description": "Location for all resources."
          }
        },
        "workspaceName": {
          "type": "String",
          "metadata": {
            "description": "The name of the Azure Databricks workspace to create."
          }
        },
        "apiVersion": {
          "defaultValue": "2023-02-01",
          "allowedValues": ["2018-04-01", "2020-02-15", "2022-04-01-preview", "2023-02-01"],
          "type": "String",
          "metadata": {
            "description": "2018-03-15 for 'full region isolation control plane' and 2020-02-15 for 'FedRAMP certified' regions"
          }
        },
        "enableNoPublicIp": {
          "defaultValue": true,
          "type": "Bool"
        },
        "pricingTier": {
          "defaultValue": "premium",
          "allowedValues": ["premium", "standard", "trial"],
          "type": "String",
          "metadata": {
            "description": "The pricing tier of workspace."
          }
        },
        "publicNetworkAccess": {
          "type": "string",
          "defaultValue": "Enabled",
          "allowedValues": ["Enabled", "Disabled"],
          "metadata": {
            "description": "Indicates whether public network access is allowed to the workspace - possible values are Enabled or Disabled."
          }
        },
        "requiredNsgRules": {
          "type": "string",
          "defaultValue": "AllRules",
          "allowedValues": ["AllRules", "NoAzureDatabricksRules"],
          "metadata": {
            "description": "Indicates whether to retain or remove the AzureDatabricks outbound NSG rule - possible values are AllRules or NoAzureDatabricksRules."
          }
        }
      },
      "variables": {
        "managedResourceGroupName": "[concat('databricks-rg-', parameters('workspaceName'), '-', uniqueString(parameters('workspaceName'), resourceGroup().id))]",
        "managedResourceGroupId": "[subscriptionResourceId('Microsoft.Resources/resourceGroups', variables('managedResourceGroupName'))]"
      },
      "resources": [
        {
          "type": "Microsoft.Databricks/workspaces",
          "apiVersion": "[parameters('apiVersion')]",
          "name": "[parameters('workspaceName')]",
          "location": "[parameters('location')]",
          "sku": {
            "name": "[parameters('pricingTier')]"
          },
          "properties": {
            "ManagedResourceGroupId": "[variables('managedResourceGroupId')]",
            "publicNetworkAccess": "[parameters('publicNetworkAccess')]",
            "requiredNsgRules": "[parameters('requiredNsgRules')]",
            "parameters": {
              "enableNoPublicIp": {
                "value": "[parameters('enableNoPublicIp')]"
              }
            }
          }
        }
      ]
    }
    
    1. Go to the Azure portal Custom deployment page.

    2. Click Build your own template in the editor.

    3. Paste in the JSON for the template that you copied.

    4. Click Save.

    5. Заполните параметры.

    6. Чтобы обновить существующую рабочую область, используйте те же параметры, которые использовались для создания рабочей области, отличной от enableNoPublicIp, которую необходимо задать для true. Задайте подписку, регион, имя рабочей области, имена подсетей, идентификатор ресурса существующей виртуальной сети.

      Important

      The resource group name, workspace name, and subnet names are identical to your existing workspace so that this command updates the existing workspace rather than creating a new workspace.

    7. Click Review + Create.

    8. If there are no validation issues, click Create.

    Обновление сети может занять более 15 минут.

Применить обновление с помощью Terraform

Для рабочих областей, созданных с помощью Terraform, можно обновить рабочую область без повторного создания рабочей области.

Important

You must use terraform-provider-azurerm version 3.41.0 or later, so upgrade your Terraform provider version as needed. Earlier versions attempt to recreate the workspace if you change any of these settings.

Change the following workspace settings:

  • no_public_ip in the custom_parameters block can be changed from false to true.

Обновление сети может занять более 15 минут.

шаг 3. Проверка обновления

Когда рабочая область находится в активном состоянии, задание обновления будет завершено. Убедитесь, что обновление было применено:

  1. Open Azure Databricks in your web browser.

  2. Start one of the workspace’s clusters and wait until the cluster is fully started.

  3. Go to your workspace instance in the Azure portal.

  4. Click the blue ID next to the field label Managed Resource Group.

  5. In that group, find the VMs for the cluster and click on one of them.

  6. In the VM settings, within Properties, look for the fields in the Networking area.

  7. Confirm that the Public IP address field is empty.

    Если он заполнен, виртуальная машина имеет общедоступный IP-адрес, то есть обновление завершилось сбоем.

Temporary rollback of upgrading to secure cluster connectivity

If something goes wrong during deployment you can reverse the process as a temporary rollback, but disabling SCC on a workspace is not supported other than for temporary rollback before continuing the upgrade later. Если это необходимо временно, можно следовать приведенным выше инструкциям по обновлению, но присвоить enableNoPublicIp значение false вместо true.

Egress from workspace subnets

When you enable secure cluster connectivity, both of your workspace subnets are private subnets, since cluster nodes do not have public IP addresses.

The implementation details of network egress vary based on whether you use the default (managed) VNet or whether you use the VNet injection to provide your own VNet in which to deploy your workspace.

Important

Additional costs may be incurred due to increased egress traffic when you use secure cluster connectivity. Для наиболее безопасного развертывания Корпорация Майкрософт и Databricks настоятельно рекомендует включить безопасное подключение к кластеру.

Egress with default (managed) VNet

If you use secure cluster connectivity with the default VNet that Azure Databricks creates, Azure Databricks automatically creates a NAT gateway for outbound traffic from your workspace’s subnets to the Azure backbone and public network. The NAT gateway is created within the managed resource group managed by Azure Databricks. You cannot modify this resource group or any resources provisioned within it. Этот шлюз NAT несет дополнительные затраты.

Egress with VNet injection

Если вы включите безопасное подключение к кластеру в рабочей области, использующую внедрение виртуальной сети, Databricks рекомендует, чтобы в вашей рабочей области был стабильный исходящий общедоступный IP-адрес. Stable egress public IP addresses are useful because you can add them to external allow lists. For example, to connect from Azure Databricks to Salesforce with a stable outgoing IP address.

Warning

Microsoft announced that on September 30, 2025, default outbound access connectivity for virtual machines in Azure will be retired. See this announcement. This means that existing Azure Databricks workspaces that use default outbound access rather than a stable egress public IP might not continue to work after that date. Databricks recommends that you add explicit outbound methods for your workspaces before that date.

To add explicit outbound methods for you workspace, use an Azure NAT gateway or user-defined routes (UDRs).

  • шлюз NAT Azure: используйте шлюз NAT Azure, если вашим развертываниям требуется только небольшая настройка. Configure the gateway on both of the workspace’s subnets to ensure that all outbound traffic to the Azure backbone and public network transits through it. Clusters have a stable egress public IP, and you can modify the configuration for custom egress needs. You can configure this using either an Azure template or from the Azure portal.
  • UDRs: Use UDRs if your deployments require complex routing requirements or your workspaces use VNet injection with an egress firewall. UDRs ensure that network traffic is routed correctly for your workspace, either directly to the required endpoints or through an egress firewall. Чтобы использовать UDR, необходимо добавить прямые маршруты или разрешенные правила брандмауэра для ретранслятора защищенного подключения к кластеру Azure Databricks и других необходимых конечных точек, перечисленных в разделе пользовательских параметров маршрута для Azure Databricks.

Warning

Do not use an egress load balancer with a workspace that has secure cluster connectivity enabled. In production systems, an egress load balancer can lead to risk of exhausting ports.