需要托管专用终结点才能连接到受高度保护的 Azure 资源。 它们是单向专用连接,允许 Azure 数据资源管理器连接到其他受保护的服务。 本文介绍如何创建托管专用终结点并将其连接到数据源。
- Azure 订阅。 创建 Azure 帐户。
- 一个未注入到虚拟网络中的 Azure 数据资源管理器群集。
- 注册到 Microsoft.Network 资源提供程序的订阅中的事件中心或 Azure 存储 Blob。 有关详细信息,请参阅将订阅注册到资源提供程序。
可以使用门户创建托管专用终结点,供群集在访问存储时使用。
在 Azure 门户中,导航到群集,然后选择“网络”。
选择“托管专用终结点”,然后选择“添加”。
在“新建托管专用终结点”窗格中,使用以下信息填写资源详细信息,然后选择“下一步”。
设置 建议的值 字段说明 名称 mpeToStorage 托管专用终结点的名称 订阅 订阅 选择要用于群集的 Azure 订阅 资源类型 Microsoft.Storage/storageAccounts 选择数据源所需的相关资源类型。 资源名称 共享 选择应用作新 Azure 专用终结点目标的群集 目标子资源 blob 选择数据源的相关目标。 选择“创建”以创建托管专用终结点资源。
创建托管专用终结点需要对 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”子资源。
安装 choco
安装 ARMClient
choco install armclient
使用 ARMClient 登录
armclient login
使用以下 REST API 调用为事件中心服务启用托管专用终结点:
运行以下命令以创建事件中心服务的托管专用终结点:
# 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.' } } "@
检查响应。
{ "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" } }
使用以下 REST API 调用将托管专用终结点启用到 Azure 存储 blob:
运行以下命令,创建事件中心的托管专用终结点:
#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.' } } "@
检查响应。
{ "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" } }
若要检查托管专用终结点迁移的进度,请使用以下命令:
运行以下命令:
#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
检查响应。
{ "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" } }
无论使用哪种方法创建托管专用终结点,都必须在目标资源上批准其创建。 若要为事件中心服务批准一个托管专用终结点,请执行以下操作:
群集现在可以使用托管专用终结点连接连接到资源。
可以使用 ARM 模板和 Terraform 创建多个托管专用终结点。 下面的示例确保先为事件中心命名空间创建了托管专用终结点,然后再为存储帐户创建了一个托管专用终结点。
下面的示例使用 ARM 模板在 Azure 数据资源管理器群集中创建了两个托管专用终结点。 第一个终结点连接到事件中心命名空间。 第二个终结点连接到存储帐户,其依赖项可确保首先创建事件中心终结点。
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"cluster_name": {
"defaultValue": "<ADX cluster name>",
"type": "String"
},
"eventhub_resource_id": {
"defaultValue": "<Eventhub resource id>",
"type": "String"
},
"storage_resource_id": {
"defaultValue": "<Storage resource id>",
"type": "String"
},
"managed_pe_eventhub_name": {
"defaultValue": "<name of the managed private endpoint to Event Hub>",
"type": "String"
},
"managed_pe_storage_name": {
"defaultValue": "<name of the managed private endpoint to Storage>",
"type": "String"
}
},
"variables": {},
"resources": [
{
"type": "Microsoft.Kusto/Clusters",
"apiVersion": "2023-08-15",
"name": "[parameters('cluster_name')]",
"location": "<region of the cluster>",
"sku": {...},
"zones": {...}
"properties": {...}
},
{
"type": "Microsoft.Kusto/Clusters/ManagedPrivateEndpoints",
"apiVersion": "2023-08-15",
"name": "[concat(parameters('cluster_name'), '/', parameters('managed_pe_eventhub_name'))]",
"dependsOn": [
"[resourceId('Microsoft.Kusto/Clusters', parameters('cluster_name'))]"
],
"properties": {
"privateLinkResourceId": "[parameters('eventhub_resource_id')]",
"groupId": "namespace",
"requestMessage": "Please approve"
}
},
{
"type": "Microsoft.Kusto/Clusters/ManagedPrivateEndpoints",
"apiVersion": "2023-08-15",
"name": "[concat(parameters('cluster_name'), '/', parameters('managed_pe_storage_name'))]",
"dependsOn": [
"[resourceId('Microsoft.Kusto/Clusters', parameters('cluster_name'))]",
"[resourceId('Microsoft.Kusto/Clusters/ManagedPrivateEndpoints', parameters('cluster_name'), parameters('managed_pe_eventhub_name'))]"
],
"properties": {
"privateLinkResourceId": "[parameters('storage_resource_id')]",
"groupId": "blob",
"requestMessage": "Please approve"
}
}
]
}
如果请求标识对托管专用终结点的目标资源具有 Microsoft.<Provider>/<ResourceType>/privateEndpointConnectionsApproval/action 权限,则可以自动批准托管专用终结点。