你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

通过共享专用终结点访问专用网络中的密钥保管库

Azure Web PubSub 服务可以通过共享专用终结点连接访问专用网络中的密钥保管库。 本文介绍如何配置 Web PubSub 服务实例,以通过共享专用终结点而不是公用网络将出站调用路由到密钥保管库。

Diagram showing architecture of shared private endpoint.

通过 Azure Web PubSub 服务 API 创建的安全资源的专用终结点称为“共享专用链接资源”。 这是因为你是在“共享”对已与 Azure 专用链接服务集成的资源(例如 Azure Key Vault)的访问权限。 这些专用终结点是在 Azure Web PubSub 服务执行环境中创建的,不会直接显示出来。

注意

本文中的示例使用以下资源 ID:

  • 此 Azure Web PubSub 服务的资源 ID 为 _/subscriptions/0000000-0000-0000-0000-0000000000000/resourceGroups/contoso/providers/Microsoft.SignalRService/webpubsub/contoso-webpubsub。
  • Azure Key Vault 的资源 ID 为 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso/providers/Microsoft.KeyVault/vaults/contoso-kv。

执行这些步骤时,请将占位符替换为你的 Azure Web PubSub 服务和 Azure 密钥保管库的资源 ID。

先决条件

1. 为密钥保管库创建共享专用终结点资源

  1. 在 Azure 门户中,转到 Azure Web PubSub 服务资源页。

  2. 在菜单中选择“网络”。

  3. 选择“专用访问”选项卡。

  4. 选择“添加共享专用终结点”。

    Screenshot of shared private endpoints management.

  5. 输入共享专用终结点的名称。

  6. 输入你的密钥保管库资源,方法是选择“从资源中选择”并从列表中选择你的资源来,或选择“指定资源 ID”并输入你的密钥保管库资源 ID。

  7. 为“请求消息”输入“请批准”。

  8. 选择添加

    Screenshot of adding a shared private endpoint.

共享专用终结点资源的预配状态为“成功”。 连接状态是目标资源端的“挂起”审批。

Screenshot of an added shared private endpoint.

2. 批准密钥保管库的专用终结点连接

创建专用终结点连接后,需要在密钥保管库资源中批准来自 Azure Web PubSub 服务的连接请求。

  1. 在 Azure 门户中,转到密钥保管库资源页。

  2. 在菜单中选择“网络”。

  3. 选择“专用终结点连接”。

    Screenshot of the Azure portal, showing the Private endpoint connections pane.

  4. 选择 Azure Web PubSub 服务创建的专用终结点。

  5. 选择“批准”,然后选择“是”以确认。

  6. 等待专用终结点连接获得批准。

    Screenshot of the Azure portal, showing an Approved status on the Private endpoint connections pane.

批准状态需要在几分钟后才会传播到 Azure Web PubSub 服务。 你可以使用 Azure 门户或 Azure CLI 来检查状态。 容器处于已批准状态后,Azure Web PubSub 服务和 Azure 密钥保管库之间的共享专用终结点将处于活动状态。

  1. 在 Azure 门户中转到 Azure Web PubSub 服务资源。

  2. 在菜单中选择“网络”。

  3. 选择“共享专用链接资源”。

    Screenshot of an approved shared private endpoint.

现在可以像往常一样配置自定义域等功能。 不必对 Key Vault 使用特殊域。 Azure Web PubSub 服务会自动处理 DNS 解析。

后续步骤

了解详细信息: