Skip to content

Commit 132b389

Browse files
Merge pull request #291740 from craigshoemaker/webps/ropc/disclaimer
[Web PubSub] Update: Add connection string disclaimer
2 parents f61b56c + 4aa7bcd commit 132b389

23 files changed

+104
-20
lines changed

articles/azure-web-pubsub/howto-integrate-app-service.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ ms.date: 05/17/2023
1212

1313
A new class of applications is reimagining what modern work could be. While [Microsoft Word](https://www.microsoft.com/microsoft-365/word) brings editors together, [Figma](https://www.figma.com) gathers up designers on the same creative endeavor. This class of applications builds on a user experience that makes us feel connected with our remote collaborators. From a technical point of view, user's activities need to be synchronized across users' screens at a low latency.
1414

15+
[!INCLUDE [Connection string security](includes/web-pubsub-connection-string-security.md)]
16+
1517
## Overview
1618
In this how-to guide, we take a cloud-native approach and use Azure services to build a real-time collaborative whiteboard and we deploy the project as a Web App to Azure App Service. The whiteboard app is accessible in the browser and allows anyone can draw on the same canvas.
1719

@@ -81,6 +83,9 @@ In order to follow the step-by-step guide, you need
8183
```
8284
8385
1. Show and store the value of `primaryConnectionString` somewhere for later use.
86+
87+
[!INCLUDE [Connection string security comment](includes/web-pubsub-connection-string-security-comment.md)]
88+
8489
```azurecli-interactive
8590
az webpubsub key show \
8691
--name "whiteboard-app" \

articles/azure-web-pubsub/includes/cli-awps-connstr.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,10 @@
22
author: vicancy
33
ms.service: azure-web-pubsub
44
ms.topic: include
5-
ms.date: 08/06/2021
5+
ms.date: 12/10/2024
66
ms.author: lianwei
77
---
88

9-
> [!IMPORTANT]
10-
> A connection string includes the authorization information required for your application to access Azure Web PubSub service. The access key inside the connection string is similar to a root password for your service. In production environments, always be careful to protect your access keys. Use Azure Key Vault to manage and rotate your keys securely. Avoid distributing access keys to other users, hard-coding them, or saving them anywhere in plain text that is accessible to others. Rotate your keys if you believe they may have been compromised.
11-
129
Use the Azure CLI [az webpubsub key](/cli/azure/webpubsub#az-webpubsub-key) command to get the **ConnectionString** of the service. Replace the `<your-unique-resource-name>` placeholder with the name of your Azure Web PubSub instance.
1310

1411
```azurecli
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
author: vicancy
3+
ms.service: azure-web-pubsub
4+
ms.topic: include
5+
ms.date: 12/10/2024
6+
ms.author: lianwei
7+
---
8+
9+
Raw connection strings appear in this article for demonstration purposes only. In production environments, always protect your access keys. Use Azure Key Vault to manage and rotate your keys securely and [secure your connection with `WebPubSubServiceClient`](../howto-create-serviceclient-with-net-and-azure-identity.md).
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
author: vicancy
3+
ms.service: azure-web-pubsub
4+
ms.topic: include
5+
ms.date: 12/10/2024
6+
ms.author: lianwei
7+
---
8+
9+
> [!IMPORTANT]
10+
> Raw connection strings appear in this article for demonstration purposes only.
11+
>
12+
> A connection string includes the authorization information required for your application to access Azure Web PubSub service. The access key inside the connection string is similar to a root password for your service. In production environments, always protect your access keys. Use Azure Key Vault to manage and rotate your keys securely and [secure your connection with `WebPubSubServiceClient`](../howto-create-serviceclient-with-net-and-azure-identity.md).
13+
>
14+
> Avoid distributing access keys to other users, hard-coding them, or saving them anywhere in plain text that is accessible to others. Rotate your keys if you believe they may have been compromised.

articles/azure-web-pubsub/quickstart-serverless.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ In this tutorial, you learn how to:
2323
> - Configure Azure Authentication
2424
> - Configure Web PubSub Event Handler to route events and messages to the application
2525
26+
[!INCLUDE [Connection string security](includes/web-pubsub-connection-string-security.md)]
27+
2628
## Prerequisites
2729

2830
# [JavaScript Model v4](#tab/javascript-v4)
@@ -789,6 +791,8 @@ Use the following commands to create these items.
789791
790792
1. Configure the `WebPubSubConnectionString` for the function app:
791793
794+
[!INCLUDE [Connection string security comment](includes/web-pubsub-connection-string-security-comment.md)]
795+
792796
First, find your Web PubSub resource from **Azure Portal** and copy out the connection string under **Keys**. Then, navigate to Function App settings in **Azure Portal** -> **Settings** -> **Configuration**. And add a new item under **Application settings**, with name equals `WebPubSubConnectionString` and value is your Web PubSub resource connection string.
793797
794798
## Configure the Web PubSub service `Event Handler`

articles/azure-web-pubsub/quickstarts-event-notifications-from-clients.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ In this quickstart guide, we learn about the event system of Web PubSub so that
2121
2222
:::image type="content" source="media/quickstarts-event-notifications-from-clients/notification.gif" alt-text="GIF of application server receiving client events.":::
2323

24+
[!INCLUDE [Connection string security](includes/web-pubsub-connection-string-security.md)]
25+
2426
## Prerequisites
2527
- A Web PubSub resource. If you haven't created one, you can follow the guidance: [Create a Web PubSub resource](./howto-develop-create-instance.md)
2628
- A code editor, such as Visual Studio Code
@@ -142,6 +144,9 @@ npm install -g @azure/web-pubsub-tunnel-tool
142144
```
143145

144146
#### 2. Use the service connection string and run
147+
148+
[!INCLUDE [Connection string security comment](includes/web-pubsub-connection-string-security-comment.md)]
149+
145150
```bash
146151
export WebPubSubConnectionString="<your connection string>"
147152
awps-tunnel run --hub myHub1 --upstream http://localhost:8080

articles/azure-web-pubsub/quickstarts-push-messages-from-server.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ This quickstart guide demonstrates how to
2020
> * **subscribe** to messages from an application server
2121
> * **push data** from an application server to **all** connected clients
2222
23+
[!INCLUDE [Connection string security](includes/web-pubsub-connection-string-security.md)]
24+
2325
## Prerequisites
2426

2527
- A Web PubSub resource. If you haven't created one, you can follow the guidance: [Create a Web PubSub resource](./howto-develop-create-instance.md)
@@ -388,6 +390,8 @@ For this quickstart guide, we'll get it from Azure portal as shown below.
388390
#### Run the server program
389391
Run the following commands in a ***new*** command shell.
390392

393+
[!INCLUDE [Connection string security comment](includes/web-pubsub-connection-string-security-comment.md)]
394+
391395
```bash
392396
# Set the environment variable for your connection string.
393397
export WebPubSubConnectionString="<Put your connection string here>"

articles/azure-web-pubsub/reference-client-sdk-java.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ As shown in the diagram, your clients establish WebSocket connections with your
2424

2525
:::image type="content" source="./media/reference-client-sdk-java/flow-overview.png" alt-text="Screenshot showing clients establishing WebSocket connection with a Web PubSub resource":::
2626

27+
[!INCLUDE [Connection string security](includes/web-pubsub-connection-string-security.md)]
28+
2729
## Getting started
2830

2931
### Prerequisites
@@ -66,6 +68,8 @@ WebPubSubClient client = new WebPubSubClientBuilder()
6668

6769
In production, a client usually fetches the `Client Access URL` from a negotiation server. The server holds the `connection string` and generates the `Client Access URL` through `WebPubSubServiceClient`. As a sample, the code snippet just demonstrates how to generate the `Client Access URL` inside a single process.
6870

71+
[!INCLUDE [Connection string security comment](includes/web-pubsub-connection-string-security-comment.md)]
72+
6973
```java readme-sample-createClientFromCredential
7074
// WebPubSubServiceAsyncClient is from com.azure:azure-messaging-webpubsub
7175
// create WebPubSub service client

articles/azure-web-pubsub/reference-client-sdk-javascript.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ As shown in the diagram, your clients establish WebSocket connections with your
2323

2424
:::image type="content" source="./media/reference-client-sdk-javascript/flow-overview.png" alt-text="Screenshot showing clients establishing WebSocket connection with a Web PubSub resource":::
2525

26+
[!INCLUDE [Connection string security](includes/web-pubsub-connection-string-security.md)]
27+
2628
## Getting started
2729

2830
### Prerequisites
@@ -117,6 +119,8 @@ In production, clients usually fetch `Client Access URL` from an application ser
117119
#### 1. Application server
118120
The code snippet is an example of an application server exposes a `/negotiate` endpoint and returns `Client Access URL`.
119121

122+
[!INCLUDE [Connection string security comment](includes/web-pubsub-connection-string-security-comment.md)]
123+
120124
```js
121125
// This code snippet uses the popular Express framework
122126
const express = require('express');

articles/azure-web-pubsub/reference-rest-api-data-plane.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ ms.date: 06/09/2022
1414

1515
As illustrated by the above workflow graph, and also detailed workflow described in [internals](./concept-service-internals.md), your app server can send messages to clients or to manage the connected clients using REST APIs exposed by Web PubSub service. This article describes the REST APIs in detail.
1616

17+
[!INCLUDE [Connection string security](includes/web-pubsub-connection-string-security.md)]
18+
1719
## Using REST API
1820

1921
### Authenticate via Azure Web PubSub Service AccessKey
@@ -39,6 +41,8 @@ Below claims are required to be included in the JWT token.
3941

4042
A pseudo code in JS:
4143

44+
[!INCLUDE [Connection string security comment](includes/web-pubsub-connection-string-security-comment.md)]
45+
4246
```js
4347
const bearerToken = jwt.sign({}, connectionString.accessKey, {
4448
audience: request.url,

0 commit comments

Comments
 (0)