マネージド プライベート エンドポイントは、高度に保護された Azure リソースに接続するためのオプションの方法です。 Azure Data Explorer が他の保護されたサービスに接続できるようにする一方向のプライベート接続です。 この記事では、マネージド プライベート エンドポイントを作成してデータ ソースに接続する方法について説明します。
注
マネージド プライベート エンドポイントを使用する代わりに、マネージド ID を使用して Azure Storage (Event Grid フローを除く) と Azure Event Hubs に接続します。 マネージド ID を使用して接続するには、Azure Data Explorer を信頼できるサービスとして認識するように Azure Storage または Event Hubs リソースを構成します。 次に、マネージド ID を使用して、信頼された Azure サービスのネットワーク ルール例外を作成してアクセス権を付与します。
前提条件
- Azure サブスクリプション。 無料の Azure アカウントを作成します。
- 仮想ネットワークに挿入されていない Azure Data Explorer クラスター 。
- microsoft.Network リソース プロバイダーに登録されているサブスクリプション内の イベント ハブ または Azure Storage BLOB。 詳細については、「 リソース プロバイダーへのサブスクリプションの登録」を参照してください。
Azure portal を使用してマネージド プライベート エンドポイントを作成する
ストレージにアクセスするときに使用するクラスターのポータルを使用して、マネージド プライベート エンドポイントを作成します。
Azure portal でクラスターに移動し、[ ネットワーク] を選択します。
[マネージド プライベート エンドポイント]、[追加] の順に選択します。
[ 新しいマネージド プライベート エンドポイント ] ウィンドウで、次の情報を含むリソースの詳細を入力し、[ 次へ] を選択します。
設定 推奨値 フィールドの説明 名前 mpeToStorage マネージド プライベート エンドポイントの名前 サブスクリプション 該当するサブスクリプション クラスターに使用する Azure サブスクリプションを選択します リソースの種類 Microsoft.Storage/storageAccounts データ ソースに関連するリソースの種類を選択します。 リソース名 共有 新しい Azure プライベート エンドポイントの宛先として使用するクラスターを選択します ターゲット サブリソース BLOB データ ソースに関連するターゲットを選択します。 [ 作成] を選択して、マネージド プライベート エンドポイント リソースを作成します。
REST API を使用してマネージド プライベート エンドポイントを作成する
マネージド プライベート エンドポイントを作成するには、 Kusto リソース プロバイダーに対して 1 つの 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 を使用するための前提条件
choco をインストールします
ARMClient をインストールします
choco install armclientARMClient を使用してサインインする
armclient login
Azure Event Hubs へのマネージド プライベート エンドポイントを作成する
次の REST API 呼び出しを使用して、Event Hubs サービスに対してマネージド プライベート エンドポイントを有効にします。
次のコマンドを実行して、Event Hubs サービスへのマネージド プライベート エンドポイントを作成します。
# 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" } }
Azure Storage アカウントへのマネージド プライベート エンドポイントを作成する
次の REST API 呼び出しを使用して、Azure Storage BLOB に対してマネージド プライベート エンドポイントを有効にします。
次のコマンドを実行して、Event Hubs サービスへのマネージド プライベート エンドポイントを作成します。
#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" } }
マネージド プライベート エンドポイントを承認する
マネージド プライベート エンドポイントの作成に使用する方法はどれであれ、ターゲット リソースでの作成を承認する必要があります。 Event Hubs サービスへのマネージド プライベート エンドポイントを承認するには:
Azure portal で、Event Hubs サービスに移動し、[ ネットワーク] を選択します。
[プライベート エンドポイント接続] を選択し、作成したマネージド プライベート エンドポイントを選択して、[承認] を選択します。
[接続状態] 列で、マネージド プライベート エンドポイントが承認されていることを確認します。
これで、クラスターは、マネージド プライベート エンドポイント接続を使用してリソースに接続できるようになりました。
複数のマネージド プライベート エンドポイントを作成する
ARM テンプレートと Terraform を使用して、複数のマネージド プライベート エンドポイントを作成できます。 次の例では、Event Hubs 名前空間へのマネージド プライベート エンドポイントが、ストレージ アカウントの前に作成されていることを確認します。
次の例では、ARM テンプレートを使用して、Azure Data Explorer クラスターに 2 つのマネージド プライベート エンドポイントを作成します。 最初のエンドポイントは、Event Hubs 名前空間に接続します。 2 番目のエンドポイントは、Event Hubs エンドポイントが最初に作成されることを保証する依存関係を持つストレージ アカウントに接続します。
{
"$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"
}
}
]
}
自動承認
要求元の ID に Microsoft.<Provider>/<ResourceType>/privateEndpointConnectionsApproval/action の許可が、マネージド プライベート エンドポイントの対象リソースに対して与えられている場合、マネージド プライベート エンドポイントを 自動承認 できます。