Share via


透過共用私人端點存取私人網路中的 Key Vault

Azure Web PubSub 服務可以透過共用私人端點連線,存取私人網路中的 Key Vault。 本文說明如何設定 Web PubSub 服務執行個體,以透過共用私人端點 (而非公用網路) 將輸出呼叫路由傳送至金鑰保存庫。

Diagram showing architecture of shared private endpoint.

透過 Azure Web PubSub 服務 API 所建立受保護資源的私人端點,稱為「共用私人連結資源」。 這是因為您已針對與 Azure Private Link 服務整合的資源 (例如 Azure Key Vault)「共用」存取權。 這些私人端點在 Azure Web PubSub 服務執行環境中建立,不會直接顯示出來。

注意

本文中範例使用下列資源識別碼:

  • 此 Azure Web PubSub 服務的資源識別碼是 _/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso/providers/Microsoft.SignalRService/webPubSub/contoso-webpubsub。
  • Azure Key Vault 的資源識別碼是 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso/providers/Microsoft.KeyVault/vaults/contoso-kv

遵循步驟時,請取代 Azure Web PubSub 服務和 Azure Key Vault 的資源識別碼。

必要條件

1.建立 Key Vault 的共用私人端點資源

  1. 在 Azure 入口網站中,移至您的 Azure Web PubSub 服務資源頁面。

  2. 從功能表中選取 [網路]

  3. 選取 [私人存取] 索引標籤。

  4. 選取 [新增共用私人端點]

    Screenshot of shared private endpoints management.

  5. 填入共用私人端點的名稱

  6. 選擇 [從您的資源選取] 並從清單中選取您的資源,或選擇 [指定資源識別碼] 並輸入金鑰保存庫資源識別碼,以輸入您的金鑰保存庫資源。

  7. 針對 [要求訊息] 輸入「請核准」

  8. 選取 [新增]。

    Screenshot of adding a shared private endpoint.

共用私人端點資源的佈建狀態為 [成功]。 連線狀態在目標資源端為 [待決] 核准。

Screenshot of an added shared private endpoint.

2.核准 Key Vault 的私人端點連線

建立私人端點連線之後,您必須在金鑰保存庫資源中核准來自 Azure Web PubSub 服務的連線要求。

  1. 在 Azure 入口網站中,移至您的 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 Key Vault 之間的共用私人端點會處於作用中狀態。

  1. 移至 Azure 入口網站中的 Azure Web PubSub 服務資源。

  2. 從功能表中選取 [網路]

  3. 選取 [共用私人連結資源]

    Screenshot of an approved shared private endpoint.

現在您可以像往常一樣設定自訂網域等功能。 您不需要針對 Key Vault 使用特殊網域。 Azure Web PubSub 服務會自動處理 DNS 解析。

下一步

深入了解: