Access Key Vault in private network through shared private endpoints

Azure Web PubSub Service can access your Key Vault in a private network through shared private endpoints connections. This article shows you how to configure your Web PubSub service instance to route outbound calls to a key vault through a shared private endpoint rather than public network.

Diagram showing architecture of shared private endpoint.

Private endpoints of secured resources created through Azure Web PubSub Service APIs are referred to as shared private-link resources. This is because you're "sharing" access to a resource, such as an Azure Key Vault, that has been integrated with the Azure Private Link service. These private endpoints are created inside the Azure Web PubSub Service execution environment and aren't directly visible to you.

Note

The examples in this article use the following resource IDs:

  • The resource ID of this Azure Web PubSub Service is _/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso/providers/Microsoft.SignalRService/webpubsub/contoso-webpubsub .
  • The resource ID of Azure Key Vault is /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso/providers/Microsoft.KeyVault/vaults/contoso-kv.

When following the steps, substitute the resource IDs of your Azure Web PubSub Service and Azure Key Vault.

Prerequisites

1. Create a shared private endpoint resource to the Key Vault

  1. In the Azure portal, go to your Azure Web PubSub Service resource page.

  2. Select Networking from the menu.

  3. Select the Private access tab.

  4. Select Add shared private endpoint.

    Screenshot of shared private endpoints management.

  5. Enter a Name for the shared private endpoint.

  6. Enter your key vault resource by choosing Select from your resources and selecting your resource from the lists, or by choosing Specify resource ID and entering your key vault resource ID.

  7. Enter please approve for the Request message.

  8. Select Add.

    Screenshot of adding a shared private endpoint.

The shared private endpoint resource provisioning state is Succeeded. The connection state is Pending approval at target resource side.

Screenshot of an added shared private endpoint.

2. Approve the private endpoint connection for the Key Vault

After the private endpoint connection has been created, you need to approve the connection request from the Azure Web PubSub Service in your key vault resource.

  1. In the Azure portal, go to your key vault resource page.

  2. Select Networking from the menu.

  3. Select Private endpoint connections.

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

  4. Select the private endpoint that Azure Web PubSub Service created.

  5. Select Approve and Yes to confirm.

  6. Wait for the private endpoint connection to be approved.

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

It takes a few minutes for the approval to be propagated to Azure Web PubSub Service. You can check the state using either Azure portal or Azure CLI. The shared private endpoint between Azure Web PubSub Service and Azure Key Vault is active when the container state is approved.

  1. Go to the Azure Web PubSub Service resource in the Azure portal.

  2. Select Networking from the menu.

  3. Select Shared private link resources.

    Screenshot of an approved shared private endpoint.

Now you can configure features like a custom domain as usual. You don't have to use a special domain for Key Vault. The Azure Web PubSub Service automatically handles DNS resolution.

Next steps

Learn more: