You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/azure-signalr/howto-shared-private-endpoints-key-vault.md
+62-40Lines changed: 62 additions & 40 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,53 +5,70 @@ description: Learn how Azure SignalR Service can use shared private endpoints to
5
5
services: signalr
6
6
author: ArchangelSDY
7
7
ms.service: signalr
8
-
ms.topic: article
8
+
ms.topic: how-to
9
9
ms.date: 09/23/2022
10
10
ms.author: dayshen
11
11
---
12
12
13
13
# Access Key Vault in a private network through shared private endpoints
14
14
15
-
Azure SignalR Service can access your Azure Key Vault instance in a private network through shared private endpoints. In this way, you don't have to expose your key vault on a public network.
15
+
Azure SignalR Service can access your Key Vault in a private network through Shared Private Endpoints. This way, your Key Vault isn't exposed on a public network.
16
16
17
17
:::image type="content" alt-text="Diagram that shows the architecture of a shared private endpoint." source="media\howto-shared-private-endpoints-key-vault\shared-private-endpoint-overview.png" :::
18
18
19
-
## Management of shared privatelink resources
19
+
You can create private endpoints through Azure SignalR Service APIs for shared access to a resource integrated with [Azure Private Link service](https://azure.microsoft.com/services/private-link/). These endpoints, called *shared private link resources*, are created inside the SignalR execution environment and aren't accessible outside this environment.
20
20
21
-
Private endpoints of secured resources that are created through Azure SignalR Service APIs are called *shared private link resources*. This is because you're "sharing" access to a resource, such a key vault, that has been integrated with the [Azure Private Link service](https://azure.microsoft.com/services/private-link/). These private endpoints are created inside an Azure SignalR Service execution environment and aren't directly visible to you.
21
+
In this article, you'll learn how to create a shared private endpoint to Key Vault.
22
22
23
-
> [!NOTE]
24
-
> The examples in this article are based on the following assumptions:
25
-
> * The resource ID of the Azure SignalR Service instance is _/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso/providers/Microsoft.SignalRService/signalr/contoso-signalr_.
26
-
> * The resource ID of the key vault is _/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso/providers/Microsoft.KeyVault/vaults/contoso-kv_.
23
+
## Prerequisites
27
24
28
-
The examples show how the *contoso-signalr* service can be configured so that its outbound calls to the key vault go through a private endpoint rather than a public network.
25
+
You'll need the following resources to complete this article:
29
26
30
-
## Create a shared private link resource to the key vault
27
+
- An Azure resource group.
28
+
- An Azure SignalR Service instance.
29
+
- An Azure Key Vault instance.
30
+
31
+
32
+
The examples in this article use the following naming convention, although you can use your own names instead.
33
+
34
+
- The resource ID of this Azure SignalR Service is _/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso/providers/Microsoft.SignalRService/signalr/contoso-signalr_.
35
+
- The resource ID of Azure Key Vault is _/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso/providers/Microsoft.KeyVault/vaults/contoso-kv_.
36
+
- The rest of the examples show how the *contoso-signalr* service can be configured so that its outbound calls to Key Vault go through a private endpoint rather than public network.
37
+
38
+
39
+
## Create a shared private link resource to the Key Vault
31
40
32
41
### [Azure portal](#tab/azure-portal)
33
42
34
43
1. In the Azure portal, go to your Azure SignalR Service resource.
35
-
1. On the menu pane, select **Networking**. Switch to the **Private access** tab.
36
-
1. Select **Add shared private endpoint**.
44
+
1. Select **Networking**.
45
+
1. Select the **Private access** tab.
46
+
1. Select **Add shared private endpoint** in the **Shared private endpoints** section.
37
47
38
48
:::image type="content" alt-text="Screenshot of the button for adding a shared private endpoint." source="media\howto-shared-private-endpoints-key-vault\portal-shared-private-endpoints-management.png" lightbox="media\howto-shared-private-endpoints-key-vault\portal-shared-private-endpoints-management.png" :::
39
49
40
-
1. Fill in a name for the shared private endpoint.
41
-
1. Select the target linked resource either by selecting from your owned resources or by filling in a resource ID.
50
+
Enter the following information:
51
+
| Field | Description |
52
+
| ----- | ----------- |
53
+
|**Name**| The name of the shared private endpoint. |
54
+
|**Type**| Select *Microsoft.KeyVault/vaults*|
55
+
|**Subscription**| The subscription containing your Key Vault. |
56
+
|**Resource**| Enter the name of your Key Vault resource. |
57
+
|**Request Message**| Enter "please approve" |
58
+
42
59
1. Select **Add**.
43
60
44
61
:::image type="content" alt-text="Screenshot of adding a shared private endpoint." source="media\howto-shared-private-endpoints-key-vault\portal-shared-private-endpoints-add.png" :::
45
62
46
-
1. Confirm that the shared private endpoint resource is now in a**Succeeded** provisioning state. The connection state is **Pending**at the target resource side.
63
+
When you've successfully added the private endpoint, the provisioning state will be**Succeeded**. The connection state will be **Pending**until you approve the endpoint on the Key Vault side.
47
64
48
65
:::image type="content" alt-text="Screenshot of an added shared private endpoint." source="media\howto-shared-private-endpoints-key-vault\portal-shared-private-endpoints-added.png" lightbox="media\howto-shared-private-endpoints-key-vault\portal-shared-private-endpoints-added.png" :::
49
66
50
67
### [Azure CLI](#tab/azure-cli)
51
68
52
-
You can make the following API call with the [Azure CLI](/cli/azure/) to create a shared private link resource:
69
+
Make the following API call with the [Azure CLI](/cli/azure/) to create a shared private link resource:
53
70
54
-
```dotnetcli
71
+
```azurecli
55
72
az rest --method put --uri https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso/providers/Microsoft.SignalRService/signalr/contoso-signalr/sharedPrivateLinkResources/kv-pe?api-version=2021-06-01-preview --body @create-pe.json
56
73
```
57
74
@@ -68,47 +85,48 @@ The contents of the *create-pe.json* file, which represent the request body to t
68
85
}
69
86
```
70
87
71
-
The process of creating an outbound private endpoint is a long-running (asynchronous) operation. As in all asynchronous Azure operations, the `PUT` call returns an `Azure-AsyncOperation` header value that looks like the following:
88
+
The process of creating an outbound private endpoint is a long-running (asynchronous) operation. As in all asynchronous Azure operations, the `PUT` call returns an `Azure-AsyncOperation` header value that looks like the following text:
You can poll this URI periodically to obtain the status of the operation.
78
95
79
-
If you're using the CLI, you can poll for the status by manually querying the `Azure-AsyncOperationHeader` value:
96
+
You can poll for the status by manually querying the `Azure-AsyncOperationHeader` value:
80
97
81
-
```dotnetcli
98
+
```azurecli
82
99
az rest --method get --uri https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso/providers/Microsoft.SignalRService/signalr/contoso-signalr/operationStatuses/c0786383-8d5f-4554-8d17-f16fcf482fb2?api-version=2021-06-01-preview
83
100
```
84
101
85
102
Wait until the status changes to **Succeeded** before you proceed to the next steps.
86
103
87
104
-----
88
105
89
-
## Approve the private endpoint connection for the key vault
106
+
## Approve the private endpoint connection for the Key Vault
90
107
91
108
### [Azure portal](#tab/azure-portal)
92
109
93
-
1. In the Azure portal, select the **Networking** tab for your key vault and go to **Private endpoint connections**. After the asynchronous operation has succeeded, there should be a request for a private endpoint connection with the request message from the previous API call.
110
+
1. Go to your Key Vault resource
111
+
1. Select the **Networking**.
112
+
1. Select the **Private endpoint connections** tab.
113
+
After the asynchronous operation has succeeded, there should be a request for a private endpoint connection with the request message from the previous API call.
94
114
95
-
1. Select the private endpoint that Azure SignalR Service created. Then select **Approve**.
96
-
97
-
:::image type="content" alt-text="Screenshot of the Azure portal that shows the pane for private endpoint connections." source="media\howto-shared-private-endpoints-key-vault\portal-key-vault-approve-private-endpoint.png" :::
98
-
99
-
1. Make sure that the private endpoint connection appears, as shown in the following screenshot. It could take one to two minutes for the status to be updated in the portal.
115
+
1. Select the private endpoint that SignalR Service created, then select **Approve**.
116
+
:::image type="content" source="media/howto-shared-private-endpoints-key-vault/portal-keyvault-private-endpoint-approve-connection.png" alt-text="Screenshot of Approve connection dialog for private endpoint in Azure Key Vault.":::
117
+
1. Select **Yes** to approve the connection.
100
118
101
119
:::image type="content" alt-text="Screenshot of the Azure portal that shows an Approved status on the pane for private endpoint connections." source="media\howto-shared-private-endpoints-key-vault\portal-key-vault-approved-private-endpoint.png" :::
102
120
103
121
### [Azure CLI](#tab/azure-cli)
104
122
105
-
1. List private endpoint connections:
123
+
1. List private endpoint connections.
106
124
107
-
```dotnetcli
125
+
```azurecli
108
126
az network private-endpoint-connection list -n <key-vault-resource-name> -g <key-vault-resource-group-name> --type 'Microsoft.KeyVault/vaults'
109
127
```
110
128
111
-
There should be a pending private endpoint connection. Note down its ID.
129
+
There should be a pending private endpoint connection. Note its ID.
112
130
113
131
```json
114
132
[
@@ -129,27 +147,28 @@ Wait until the status changes to **Succeeded** before you proceed to the next st
129
147
130
148
1. Approve the private endpoint connection:
131
149
132
-
```dotnetcli
150
+
```azurecli
133
151
az network private-endpoint-connection approve --id <private-endpoint-connection-id>
134
152
```
135
153
136
154
-----
137
155
138
-
## Query the status of the shared private link resource
156
+
## Verify the shared private endpoint is functional
139
157
140
-
It takes minutes for the approval to be propagated to Azure SignalR Service. You can check the state by using either the Azure portal or the Azure CLI.
158
+
After a few minutes, the approval propagates to the SignalR Service, and the connection state is set to *Approved*. You can check the state using either Azure portal or Azure CLI.
141
159
142
160
### [Azure portal](#tab/azure-portal)
143
161
144
162
:::image type="content" alt-text="Screenshot of an approved shared private endpoint." source="media\howto-shared-private-endpoints-key-vault\portal-shared-private-endpoints-approved.png" lightbox="media\howto-shared-private-endpoints-key-vault\portal-shared-private-endpoints-approved.png" :::
145
163
146
164
### [Azure CLI](#tab/azure-cli)
147
165
148
-
```dotnetcli
166
+
```azurecli
149
167
az rest --method get --uri https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso/providers/Microsoft.SignalRService/signalr/contoso-signalr/sharedPrivateLinkResources/func-pe?api-version=2021-06-01-preview
150
168
```
151
169
152
-
This command returns JSON that shows the connection state as the `status` value in the `properties` section.
170
+
The command will return a JSON object, where the connection state is shown as "status" in the "properties" section.
171
+
153
172
154
173
```json
155
174
{
@@ -165,17 +184,20 @@ This command returns JSON that shows the connection state as the `status` value
165
184
166
185
```
167
186
168
-
If the provisioning state (`properties.provisioningState`) of the resource is `Succeeded` and the connection state (`properties.status`) is `Approved`, the shared private link resource is functional and Azure SignalR Service can communicate over the private endpoint.
187
+
When the "Provisioning State" (`properties.provisioningState`) of the resource is `Succeeded` and "Connection State" (`properties.status`) is `Approved`, the shared private link resource is functional, and the SignalR Service can communicate over the private endpoint.
169
188
170
189
-----
171
190
172
-
At this point, the private endpoint between Azure SignalR Service and Azure Key Vault is established.
191
+
When the private endpoint between the SignalR Service and Azure Key Vault is functional, the value of the provisioning state is **Succeeded**, and the connection state is **Approved**.
173
192
174
-
Now you can configure features like custom domain as usual. *You don't have to use a special domain for Key Vault*. Azure SignalR Service automatically handles DNS resolution.
193
+
## Cleanup
175
194
176
-
## Next steps
195
+
If you don't plan to use the resources you've created in this article, you can delete the Resource Group.
177
196
178
-
Learn more:
197
+
>[!CAUTION]
198
+
> Deleting the resource group deletes all resources contained within it. If resources outside the scope of this article exist in the specified resource group, they will also be deleted.
199
+
200
+
## Next steps
179
201
180
202
+[What are private endpoints?](../private-link/private-endpoint-overview.md)
181
203
+[Configure a custom domain](howto-custom-domain.md)
0 commit comments