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.md
+77-13Lines changed: 77 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,7 @@ ms.author: lianwei
15
15
If you're using [serverless mode](concept-service-mode.md#serverless-mode) in Azure SignalR Service, you might have outbound traffic to upstream. Upstream such as
16
16
Azure Web App and Azure Functions, can be configured to accept connections from a list of virtual networks and refuse outside connections that originate from a public network. You can create an outbound [private endpoint connection](../private-link/private-endpoint-overview.md) to reach these endpoints.
This outbound method is subject to the following requirements:
21
21
@@ -25,21 +25,39 @@ This outbound method is subject to the following requirements:
25
25
26
26
+ The Azure Web App or Azure Function must be on certain SKUs. See [Use Private Endpoints for Azure Web App](../app-service/networking/private-endpoint.md).
27
27
28
-
## Shared Private Link Resources Management APIs
28
+
## Shared Private Link Resources Management
29
29
30
-
Private endpoints of secured resources that are created through Azure SignalR Service APIs are referred to as *shared private link resources*. This is because you're "sharing" access to a resource, such as an Azure Function, that has been integrated with the [Azure Private Link service](https://azure.microsoft.com/services/private-link/). These private endpoints are created inside Azure SignalR Service execution environment and are not directly visible to you.
31
-
32
-
At this moment, you can use Management REST API to create or delete *shared private link resources*. In the remainder of this article, we will use [Azure CLI](/cli/azure/) to demonstrate the REST API calls.
30
+
Private endpoints of secured resources that are created through Azure SignalR Service APIs are referred to as *shared private link resources*. This is because you're "sharing" access to a resource, such as an Azure Function, that has been integrated with the [Azure Private Link service](https://azure.microsoft.com/services/private-link/). These private endpoints are created inside Azure SignalR Service execution environment and aren't directly visible to you.
33
31
34
32
> [!NOTE]
35
33
> The examples in this article are based on the following assumptions:
36
34
> * The resource ID of this Azure SignalR Service is _/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso/providers/Microsoft.SignalRService/signalr/contoso-signalr_.
37
35
> * The resource ID of upstream Azure Function is _/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso/providers/Microsoft.Web/sites/contoso-func.
38
36
39
-
The rest of the examples show how the _contoso-signalr_ service can be configured so that its upstream calls to function go through a private endpoint rather than public network.
37
+
The rest of the examples show how the *contoso-signalr* service can be configured so that its upstream calls to function go through a private endpoint rather than public network.
40
38
41
39
### Step 1: Create a shared private link resource to the function
42
40
41
+
#### [Azure portal](#tab/azure-portal)
42
+
43
+
1. In the Azure portal, go to your Azure SignalR Service resource.
44
+
1. In the menu pane, select **Networking**. Switch to **Private access** tab.
1. Fill in a name for the shared private endpoint.
50
+
1. Select the target linked resource either by selecting from your owned resources or by filling a resource ID.
51
+
1. Click **Add**.
52
+
53
+
:::image type="content" alt-text="Screenshot of adding a shared private endpoint." source="media\howto-shared-private-endpoints\portal-shared-private-endpoints-add.png" :::
54
+
55
+
1. The shared private endpoint resource will be in **Succeeded** provisioning state. The connection state is **Pending** approval at target resource side.
56
+
57
+
:::image type="content" alt-text="Screenshot of an added shared private endpoint." source="media\howto-shared-private-endpoints\portal-shared-private-endpoints-added.png" lightbox="media\howto-shared-private-endpoints\portal-shared-private-endpoints-added.png" :::
58
+
59
+
#### [Azure CLI](#tab/azure-cli)
60
+
43
61
You can make the following API call with the [Azure CLI](/cli/azure/) to create a shared private link resource:
44
62
45
63
```dotnetcli
@@ -67,22 +85,23 @@ The process of creating an outbound private endpoint is a long-running (asynchro
67
85
68
86
You can poll this URI periodically to obtain the status of the operation.
69
87
70
-
If you are using the CLI, you can poll for the status by manually querying the `Azure-AsyncOperationHeader` value,
88
+
If you're using the CLI, you can poll for the status by manually querying the `Azure-AsyncOperationHeader` value,
71
89
72
-
```donetcli
90
+
```dotnetcli
73
91
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
74
92
```
75
93
76
94
Wait until the status changes to "Succeeded" before proceeding to the next steps.
77
95
78
-
### Step 2a: Approve the private endpoint connection for the function
96
+
-----
79
97
80
-
> [!NOTE]
81
-
> In this section, you use the Azure portal to walk through the approval flow for a private endpoint to Azure Function. Alternately, you could use the [REST API](/rest/api/appservice/web-apps/approve-or-reject-private-endpoint-connection) that's available via the App Service provider.
98
+
### Step 2a: Approve the private endpoint connection for the function
82
99
83
100
> [!IMPORTANT]
84
101
> After you approved the private endpoint connection, the Function is no longer accessible from public network. You may need to create other private endpoints in your own virtual network to access the Function endpoint.
85
102
103
+
#### [Azure portal](#tab/azure-portal)
104
+
86
105
1. In the Azure portal, select the **Networking** tab of your Function App and navigate to **Private endpoint connections**. Click **Configure your 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.
87
106
88
107
:::image type="content" alt-text="Screenshot of the Azure portal, showing the Private endpoint connections pane." source="media\howto-shared-private-endpoints\portal-function-approve-private-endpoint.png" :::
@@ -93,9 +112,50 @@ Wait until the status changes to "Succeeded" before proceeding to the next steps
93
112
94
113
:::image type="content" alt-text="Screenshot of the Azure portal, showing an Approved status on the Private endpoint connections pane." source="media\howto-shared-private-endpoints\portal-function-approved-private-endpoint.png" :::
95
114
115
+
#### [Azure CLI](#tab/azure-cli)
116
+
117
+
1. List private endpoint connections.
118
+
119
+
```dotnetcli
120
+
az network private-endpoint-connection list -n <function-resource-name> -g <function-resource-group-name> --type 'Microsoft.Web/sites'
121
+
```
122
+
123
+
There should be a pending private endpoint connection. Note down its ID.
124
+
125
+
```json
126
+
[
127
+
{
128
+
"id": "<id>",
129
+
"location": "",
130
+
"name": "",
131
+
"properties": {
132
+
"privateLinkServiceConnectionState": {
133
+
"actionRequired": "None",
134
+
"description": "Please approve",
135
+
"status": "Pending"
136
+
}
137
+
}
138
+
}
139
+
]
140
+
```
141
+
142
+
1. Approve the private endpoint connection.
143
+
144
+
```dotnetcli
145
+
az network private-endpoint-connection approve --id <private-endpoint-connection-id>
146
+
```
147
+
148
+
-----
149
+
96
150
### Step 2b: Query the status of the shared private link resource
97
151
98
-
It takes minutes for the approval to be propagated to Azure SignalR Service. To confirm that the shared private link resource has been updated after approval, you can also obtain the "Connection state" by using the GET API.
152
+
It takes minutes for the approval to be propagated to Azure SignalR Service. You can check the state using either Azure portal or Azure CLI.
153
+
154
+
#### [Azure portal](#tab/azure-portal)
155
+
156
+
:::image type="content" alt-text="Screenshot of an approved shared private endpoint." source="media\howto-shared-private-endpoints\portal-shared-private-endpoints-approved.png" lightbox="media\howto-shared-private-endpoints\portal-shared-private-endpoints-approved.png" :::
157
+
158
+
#### [Azure CLI](#tab/azure-cli)
99
159
100
160
```dotnetcli
101
161
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
@@ -119,6 +179,10 @@ This would return a JSON, where the connection state would show up as "status" u
119
179
120
180
If the "Provisioning State" (`properties.provisioningState`) of the resource is `Succeeded` and "Connection State" (`properties.status`) is `Approved`, it means that the shared private link resource is functional and Azure SignalR Service can communicate over the private endpoint.
121
181
182
+
-----
183
+
184
+
At this point, the private endpoint between Azure SignalR Service and Azure Function is established.
185
+
122
186
### Step 3: Verify upstream calls are from a private IP
123
187
124
188
Once the private endpoint is set up, you can verify incoming calls are from a private IP by checking the `X-Forwarded-For` header at upstream side.
@@ -129,4 +193,4 @@ Once the private endpoint is set up, you can verify incoming calls are from a pr
129
193
130
194
Learn more about private endpoints:
131
195
132
-
+[What are private endpoints?](../private-link/private-endpoint-overview.md)
196
+
+[What are private endpoints?](../private-link/private-endpoint-overview.md)
Copy file name to clipboardExpand all lines: articles/azure-web-pubsub/howto-secure-shared-private-endpoints.md
+76-12Lines changed: 76 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,7 @@ ms.author: dayshen
15
15
If you're using [event handler](concept-service-internals.md#event_handler) in Azure Web PubSub Service, you might have outbound traffic to upstream. Upstream such as
16
16
Azure Web App and Azure Functions, can be configured to accept connections from a list of virtual networks and refuse outside connections that originate from a public network. You can create an outbound [private endpoint connection](../private-link/private-endpoint-overview.md) to reach these endpoints.
This outbound method is subject to the following requirements:
21
21
@@ -25,11 +25,9 @@ This outbound method is subject to the following requirements:
25
25
26
26
+ The Azure Web App or Azure Function must be on certain SKUs. See [Use Private Endpoints for Azure Web App](../app-service/networking/private-endpoint.md).
27
27
28
-
## Shared Private Link Resources Management APIs
28
+
## Shared Private Link Resources Management
29
29
30
-
Private endpoints of secured resources that are 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 Function, that has been integrated with the [Azure Private Link service](https://azure.microsoft.com/services/private-link/). These private endpoints are created inside Azure Web PubSub Service execution environment and are not directly visible to you.
31
-
32
-
At this moment, you can use Management REST API to create or delete *shared private link resources*. In the remainder of this article, we will use [Azure CLI](/cli/azure/) to demonstrate the REST API calls.
30
+
Private endpoints of secured resources that are 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 Function, that has been integrated with the [Azure Private Link service](https://azure.microsoft.com/services/private-link/). These private endpoints are created inside Azure Web PubSub Service execution environment and aren't directly visible to you.
33
31
34
32
> [!NOTE]
35
33
> The examples in this article are based on the following assumptions:
@@ -40,6 +38,26 @@ The rest of the examples show how the _contoso-webpubsub_ service can be configu
40
38
41
39
### Step 1: Create a shared private link resource to the function
42
40
41
+
#### [Azure portal](#tab/azure-portal)
42
+
43
+
1. In the Azure portal, go to your Azure Web PubSub Service resource.
44
+
1. In the menu pane, select **Networking**. Switch to **Private access** tab.
1. Fill in a name for the shared private endpoint.
50
+
1. Select the target linked resource either by selecting from your owned resources or by filling a resource ID.
51
+
1. Click **Add**.
52
+
53
+
:::image type="content" alt-text="Screenshot of adding a shared private endpoint." source="media\howto-secure-shared-private-endpoints\portal-shared-private-endpoints-add.png" :::
54
+
55
+
1. The shared private endpoint resource will be in **Succeeded** provisioning state. The connection state is **Pending** approval at target resource side.
56
+
57
+
:::image type="content" alt-text="Screenshot of an added shared private endpoint." source="media\howto-secure-shared-private-endpoints\portal-shared-private-endpoints-added.png" lightbox="media\howto-secure-shared-private-endpoints\portal-shared-private-endpoints-added.png" :::
58
+
59
+
#### [Azure CLI](#tab/azure-cli)
60
+
43
61
You can make the following API call with the [Azure CLI](/cli/azure/) to create a shared private link resource:
44
62
45
63
```dotnetcli
@@ -67,22 +85,23 @@ The process of creating an outbound private endpoint is a long-running (asynchro
67
85
68
86
You can poll this URI periodically to obtain the status of the operation.
69
87
70
-
If you are using the CLI, you can poll for the status by manually querying the `Azure-AsyncOperationHeader` value,
88
+
If you're using the CLI, you can poll for the status by manually querying the `Azure-AsyncOperationHeader` value,
71
89
72
-
```donetcli
90
+
```dotnetcli
73
91
az rest --method get --uri https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso/providers/Microsoft.SignalRService/webPubSub/contoso-webpubsub/operationStatuses/c0786383-8d5f-4554-8d17-f16fcf482fb2?api-version=2021-06-01-preview
74
92
```
75
93
76
94
Wait until the status changes to "Succeeded" before proceeding to the next steps.
77
95
78
-
### Step 2a: Approve the private endpoint connection for the function
96
+
-----
79
97
80
-
> [!NOTE]
81
-
> In this section, you use the Azure portal to walk through the approval flow for a private endpoint to Azure Function. Alternately, you could use the [REST API](/rest/api/appservice/web-apps/approve-or-reject-private-endpoint-connection) that's available via the App Service provider.
98
+
### Step 2a: Approve the private endpoint connection for the function
82
99
83
100
> [!IMPORTANT]
84
101
> After you approved the private endpoint connection, the Function is no longer accessible from public network. You may need to create other private endpoints in your own virtual network to access the Function endpoint.
85
102
103
+
#### [Azure portal](#tab/azure-portal)
104
+
86
105
1. In the Azure portal, select the **Networking** tab of your Function App and navigate to **Private endpoint connections**. Click **Configure your 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.
87
106
88
107
:::image type="content" alt-text="Screenshot of the Azure portal, showing the Private endpoint connections pane." source="media\howto-secure-shared-private-endpoints\portal-function-approve-private-endpoint.png" lightbox="media\howto-secure-shared-private-endpoints\portal-function-approve-private-endpoint.png" :::
@@ -93,9 +112,50 @@ Wait until the status changes to "Succeeded" before proceeding to the next steps
93
112
94
113
:::image type="content" alt-text="Screenshot of the Azure portal, showing an Approved status on the Private endpoint connections pane." source="media\howto-secure-shared-private-endpoints\portal-function-approved-private-endpoint.png" lightbox="media\howto-secure-shared-private-endpoints\portal-function-approved-private-endpoint.png" :::
95
114
115
+
#### [Azure CLI](#tab/azure-cli)
116
+
117
+
1. List private endpoint connections.
118
+
119
+
```dotnetcli
120
+
az network private-endpoint-connection list -n <function-resource-name> -g <function-resource-group-name> --type 'Microsoft.Web/sites'
121
+
```
122
+
123
+
There should be a pending private endpoint connection. Note down its ID.
124
+
125
+
```json
126
+
[
127
+
{
128
+
"id": "<id>",
129
+
"location": "",
130
+
"name": "",
131
+
"properties": {
132
+
"privateLinkServiceConnectionState": {
133
+
"actionRequired": "None",
134
+
"description": "Please approve",
135
+
"status": "Pending"
136
+
}
137
+
}
138
+
}
139
+
]
140
+
```
141
+
142
+
1. Approve the private endpoint connection.
143
+
144
+
```dotnetcli
145
+
az network private-endpoint-connection approve --id <private-endpoint-connection-id>
146
+
```
147
+
148
+
-----
149
+
96
150
### Step 2b: Query the status of the shared private link resource
97
151
98
-
It takes minutes for the approval to be propagated to Azure Web PubSub Service. To confirm that the shared private link resource has been updated after approval, you can also obtain the "Connection state" by using the GET API.
152
+
It takes minutes for the approval to be propagated to Azure Web PubSub Service. You can check the state using either Azure portal or Azure CLI.
153
+
154
+
#### [Azure portal](#tab/azure-portal)
155
+
156
+
:::image type="content" alt-text="Screenshot of an approved shared private endpoint." source="media\howto-secure-shared-private-endpoints\portal-shared-private-endpoints-approved.png" lightbox="media\howto-secure-shared-private-endpoints\portal-shared-private-endpoints-approved.png" :::
157
+
158
+
#### [Azure CLI](#tab/azure-cli)
99
159
100
160
```dotnetcli
101
161
az rest --method get --uri https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso/providers/Microsoft.SignalRService/webPubSub/contoso-webpubsub/sharedPrivateLinkResources/func-pe?api-version=2021-06-01-preview
@@ -119,6 +179,10 @@ This would return a JSON, where the connection state would show up as "status" u
119
179
120
180
If the "Provisioning State" (`properties.provisioningState`) of the resource is `Succeeded` and "Connection State" (`properties.status`) is `Approved`, it means that the shared private link resource is functional and Azure Web PubSub Service can communicate over the private endpoint.
121
181
182
+
-----
183
+
184
+
At this point, the private endpoint between Azure SignalR Service and Azure Function is established.
185
+
122
186
### Step 3: Verify upstream calls are from a private IP
123
187
124
188
Once the private endpoint is set up, you can verify incoming calls are from a private IP by checking the `X-Forwarded-For` header at upstream side.
@@ -129,4 +193,4 @@ Once the private endpoint is set up, you can verify incoming calls are from a pr
129
193
130
194
Learn more about private endpoints:
131
195
132
-
+[What are private endpoints?](../private-link/private-endpoint-overview.md)
196
+
+[What are private endpoints?](../private-link/private-endpoint-overview.md)
0 commit comments