为 Azure 数据资源管理器创建托管专用终结点

需要托管专用终结点才能连接到受高度保护的 Azure 资源。 它们是单向专用连接,允许 Azure 数据资源管理器连接到其他受保护的服务。 本文介绍如何创建托管专用终结点并将其连接到数据源。

先决条件

使用 Azure 门户创建托管专用终结点

可以使用门户创建托管专用终结点,供群集在访问存储时使用。

  1. 在 Azure 门户中,导航到群集,然后选择“网络”。

  2. 选择“托管专用终结点”,然后选择“添加”。

    Screenshot of the networking page, showing the first step in the creation of a managed private endpoint.

  3. 在“新建托管专用终结点”窗格中,使用以下信息填写资源详细信息,然后选择“下一步”。

    Screenshot of the networking page, showing the second step in the creation of a managed private endpoint.

    设置 建议的值 字段说明
    名称 mpeToStorage 托管专用终结点的名称
    订阅 订阅 选择要用于群集的 Azure 订阅
    资源类型 Microsoft.Storage/storageAccounts 选择数据源所需的相关资源类型。
    资源名称 共享 选择应用作新 Azure 专用终结点目标的群集
    目标子资源 blob 选择数据源的相关目标。
  4. 选择“创建”以创建托管专用终结点资源。

使用 REST API 创建托管专用终结点

创建托管专用终结点需要对 Kusto 资源提供程序进行一次 API 调用。 可以为以下资源类型建立托管专用终结点:

  • Microsoft.Storage/storageAccounts(子资源可以是“blob”或“dfs”)
  • Microsoft.EventHub/namespaces(子资源“namespace”)
  • Microsoft.Devices/IoTHubs(子资源“iotHub”)
  • Microsoft.KeyVault/vaults(子资源“vault”)
  • Microsoft.Sql/servers(子资源“sqlServer”)
  • Microsoft.Kusto/clusters(子资源“cluster”)
  • Microsoft.DigitalTwins/digitalTwinsInstance(子资源“digitaltwinsinstance”)

在下面的示例中,你将使用 PowerShell 中的 ARMclient 通过 REST API 创建托管专用终结点。

注意

连接到存储帐户,“dfs”资源需要将额外的托管专用终结点连接到“blob”子资源。

使用 REST API 的先决条件

  1. 安装 choco

  2. 安装 ARMClient

    choco install armclient
    
  3. 使用 ARMClient 登录

    armclient login
    

创建 Azure 事件中心的托管专用终结点

使用以下 REST API 调用为事件中心服务启用托管专用终结点:

  1. 运行以下命令以创建事件中心服务的托管专用终结点:

    # Replace the <...> placeholders with the correct values
    armclient PUT /subscriptions/<subscriptionIdADX>/resourceGroups/<resourceGroupNameADX>/providers/Microsoft.Kusto/clusters/<clusterName>/managedPrivateEndpoints/<newMpeName>?api-version=2022-02-01 @"
    {
        'properties': {
            'privateLinkResourceId':'/subscriptions/<subscriptionIdEventHub>/resourceGroups/<resourceGroupNameEventHub>/providers/Microsoft.EventHub/namespaces/<EventHubNamespace>',
            'groupId':'namespace',
            'requestMessage':'Please Approve.'
        }
    }
    "@
    
  2. 检查响应。

    {
      "id": "/subscriptions/<subscriptionIdADX>/resourceGroups/<resourceGroupNameADX>/providers/Microsoft.Kusto/Clusters/<clusterName>/ManagedPrivateEndpoints/<newMpeName>",
      "name": "<clusterName>/<newMpeName>",
      "type": "Microsoft.Kusto/Clusters/ManagedPrivateEndpoints",
      "location": "DummyLocation",
      "properties": {
        "privateLinkResourceId": "/subscriptions/<subscriptionIdEventHub>/resourceGroups/<resourceGroupNameEventHub>/providers/Microsoft.EventHub/namespaces/<EventHubNamespace>",
        "groupId": "namespace",
        "requestMessage": "Please Approve.",
        "provisioningState": "Creating"
      }
    }
    

创建 Azure 存储帐户的托管专用终结点

使用以下 REST API 调用将托管专用终结点启用到 Azure 存储 blob:

  1. 运行以下命令,创建事件中心的托管专用终结点:

    #replace the <...> placeholders with the correct values
    armclient PUT /subscriptions/<subscriptionIdADX>/resourceGroups/<resourceGroupNameADX>/providers/Microsoft.Kusto/clusters/<clusterName>/managedPrivateEndpoints/<newMpeName>?api-version=2022-02-01 @"
    {
        'properties': {
            'privateLinkResourceId':'/subscriptions/<subscriptionIdStorage>/resourceGroups/<resourceGroupNameStorage>/providers/Microsoft.Storage/storageAccounts/<storageAccountName>',
            'groupId':'blob',
            'requestMessage':'Please Approve.'
        }
    }
    "@
    
  2. 检查响应。

    {
      "id": "/subscriptions/<subscriptionIdADX>/resourceGroups/<resourceGroupNameADX>/providers/Microsoft.Kusto/Clusters/<clusterName>/ManagedPrivateEndpoints/<newMpeName>",
      "name": "<clusterName>/<newMpeName>",
      "type": "Microsoft.Kusto/Clusters/ManagedPrivateEndpoints",
      "location": "DummyLocation",
      "properties": {
        "privateLinkResourceId": "/subscriptions/<subscriptionIdStorage>/resourceGroups/<resourceGroupNameStorage>/providers/Microsoft.Storage/storageAccounts/<storageAccountName>",
        "groupId": "blob",
        "requestMessage": "Please Approve.",
        "provisioningState": "Creating"
      }
    }
    

如何检查进度

若要检查托管专用终结点迁移的进度,请使用以下命令:

  1. 运行以下命令:

    #replace the <...> placeholders with the correct values
    armclient GET /subscriptions/<subscriptionIdADX>/resourceGroups/<resourceGroupNameADX>/providers/Microsoft.Kusto/clusters/<clusterName>/managedPrivateEndpoints/<newMpeName>?api-version=2022-02-01
    
  2. 检查响应。

    {
      "id": "/subscriptions/<subscriptionIdADX>/resourceGroups/<resourceGroupNameADX>/providers/Microsoft.Kusto/Clusters/<clusterName>/ManagedPrivateEndpoints/<newMpeName>",
      "name": "<clusterName>/<newMpeName>",
      "type": "Microsoft.Kusto/Clusters/ManagedPrivateEndpoints",
      "location": "DummyLocation",
      "properties": {
        "privateLinkResourceId": "/subscriptions/02de0e00-8c52-405c-9088-1342de78293d/resourceGroups/<resourceGroupNameADX>/providers/Microsoft.<service>/<...>/<name>",
        "groupId": "<groupId>",
        "requestMessage": "Please Approve.",
        "provisioningState": "Succeeded"
      },
      "systemData": {
        "createdBy": "<UserName>",
        "createdByType": "User",
        "createdAt": "2022-02-05T08:29:54.2912851Z",
        "lastModifiedBy": "chrisqpublic@contoso.com",
        "lastModifiedByType": "User",
        "lastModifiedAt": "2022-02-05T08:29:54.2912851Z"
      }
    }
    

批准托管专用终结点

无论使用哪种方法创建托管专用终结点,都必须在目标资源上批准其创建。 以下示例演示了如何批准为事件中心服务创建托管专用终结点。

  1. 在 Azure 门户中,导航到事件中心,然后选择“网络”。

  2. 选择“专用终结点连接”,选择创建的托管专用终结点,然后选择“批准”。

    Screenshot of the networking page, showing the approval of the managed private endpoint to the Event Hubs service.

  3. 在“连接状态”列中,验证托管专用终结点是否已获批准。

    Screenshot of the networking page, showing the approved managed private endpoint to the Event Hubs service.

群集现在可以使用托管专用终结点连接连接到资源。