Skip to content

Commit 73cc7d8

Browse files
authored
Merge pull request #189073 from ArchangelSDY/signalr-shrpvtlnk
Add portal guide for shared private endpoint
2 parents 9c91b7a + c5c5674 commit 73cc7d8

10 files changed

+153
-25
lines changed

articles/azure-signalr/howto-shared-private-endpoints.md

Lines changed: 77 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ ms.author: lianwei
1515
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
1616
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.
1717

18-
:::image type="content" alt-text="Shared private endpoint overview." source="media\howto-shared-private-endpoints\shared-private-endpoint-overview.png" :::
18+
:::image type="content" alt-text="Diagram showing architecture of shared private endpoint." source="media\howto-shared-private-endpoints\shared-private-endpoint-overview.png" :::
1919

2020
This outbound method is subject to the following requirements:
2121

@@ -25,21 +25,39 @@ This outbound method is subject to the following requirements:
2525

2626
+ 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).
2727

28-
## Shared Private Link Resources Management APIs
28+
## Shared Private Link Resources Management
2929

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.
3331

3432
> [!NOTE]
3533
> The examples in this article are based on the following assumptions:
3634
> * The resource ID of this Azure SignalR Service is _/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso/providers/Microsoft.SignalRService/signalr/contoso-signalr_.
3735
> * The resource ID of upstream Azure Function is _/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso/providers/Microsoft.Web/sites/contoso-func.
3836
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.
4038

4139
### Step 1: Create a shared private link resource to the function
4240

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.
45+
1. Click **Add shared private endpoint**.
46+
47+
:::image type="content" alt-text="Screenshot of shared private endpoints management." source="media\howto-shared-private-endpoints\portal-shared-private-endpoints-management.png" lightbox="media\howto-shared-private-endpoints\portal-shared-private-endpoints-management.png" :::
48+
49+
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+
4361
You can make the following API call with the [Azure CLI](/cli/azure/) to create a shared private link resource:
4462

4563
```dotnetcli
@@ -67,22 +85,23 @@ The process of creating an outbound private endpoint is a long-running (asynchro
6785

6886
You can poll this URI periodically to obtain the status of the operation.
6987

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,
7189

72-
```donetcli
90+
```dotnetcli
7391
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
7492
```
7593

7694
Wait until the status changes to "Succeeded" before proceeding to the next steps.
7795

78-
### Step 2a: Approve the private endpoint connection for the function
96+
-----
7997

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
8299

83100
> [!IMPORTANT]
84101
> 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.
85102
103+
#### [Azure portal](#tab/azure-portal)
104+
86105
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.
87106

88107
:::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
93112

94113
:::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" :::
95114

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+
96150
### Step 2b: Query the status of the shared private link resource
97151
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)
99159
100160
```dotnetcli
101161
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
119179

120180
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.
121181

182+
-----
183+
184+
At this point, the private endpoint between Azure SignalR Service and Azure Function is established.
185+
122186
### Step 3: Verify upstream calls are from a private IP
123187

124188
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
129193

130194
Learn more about private endpoints:
131195

132-
+ [What are private endpoints?](../private-link/private-endpoint-overview.md)
196+
+ [What are private endpoints?](../private-link/private-endpoint-overview.md)
18.2 KB
Loading
26.7 KB
Loading
26.9 KB
Loading
89.4 KB
Loading

articles/azure-web-pubsub/howto-secure-shared-private-endpoints.md

Lines changed: 76 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ ms.author: dayshen
1515
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
1616
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.
1717

18-
:::image type="content" alt-text="Shared private endpoint overview." source="media\howto-secure-shared-private-endpoints\shared-private-endpoint-overview.png" border="false" :::
18+
:::image type="content" alt-text="Diagram showing architecture of shared private endpoint." source="media\howto-secure-shared-private-endpoints\shared-private-endpoint-overview.png" border="false" :::
1919

2020
This outbound method is subject to the following requirements:
2121

@@ -25,11 +25,9 @@ This outbound method is subject to the following requirements:
2525

2626
+ 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).
2727

28-
## Shared Private Link Resources Management APIs
28+
## Shared Private Link Resources Management
2929

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.
3331

3432
> [!NOTE]
3533
> 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
4038

4139
### Step 1: Create a shared private link resource to the function
4240

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.
45+
1. Click **Add shared private endpoint**.
46+
47+
:::image type="content" alt-text="Screenshot of shared private endpoints management." source="media\howto-secure-shared-private-endpoints\portal-shared-private-endpoints-management.png" lightbox="media\howto-secure-shared-private-endpoints\portal-shared-private-endpoints-management.png" :::
48+
49+
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+
4361
You can make the following API call with the [Azure CLI](/cli/azure/) to create a shared private link resource:
4462

4563
```dotnetcli
@@ -67,22 +85,23 @@ The process of creating an outbound private endpoint is a long-running (asynchro
6785

6886
You can poll this URI periodically to obtain the status of the operation.
6987

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,
7189

72-
```donetcli
90+
```dotnetcli
7391
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
7492
```
7593

7694
Wait until the status changes to "Succeeded" before proceeding to the next steps.
7795

78-
### Step 2a: Approve the private endpoint connection for the function
96+
-----
7997

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
8299

83100
> [!IMPORTANT]
84101
> 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.
85102
103+
#### [Azure portal](#tab/azure-portal)
104+
86105
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.
87106

88107
:::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
93112

94113
:::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" :::
95114

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+
96150
### Step 2b: Query the status of the shared private link resource
97151
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)
99159
100160
```dotnetcli
101161
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
119179

120180
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.
121181

182+
-----
183+
184+
At this point, the private endpoint between Azure SignalR Service and Azure Function is established.
185+
122186
### Step 3: Verify upstream calls are from a private IP
123187

124188
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
129193

130194
Learn more about private endpoints:
131195

132-
+ [What are private endpoints?](../private-link/private-endpoint-overview.md)
196+
+ [What are private endpoints?](../private-link/private-endpoint-overview.md)
18.2 KB
Loading
26.7 KB
Loading
26.9 KB
Loading
Loading

0 commit comments

Comments
 (0)