Skip to content

Commit bfff908

Browse files
Merge pull request #261686 from Akhilesh-microsoft/AWP/Serverless_notification
[Awp/serverless notification]: Verified, reviewed, and fixed all the issues in the content.
2 parents 2f8ac01 + cd04064 commit bfff908

4 files changed

Lines changed: 32 additions & 32 deletions

File tree

articles/azure-signalr/signalr-quickstart-dotnet.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ ms.author: lianwei
1212

1313
# Quickstart: Create a chat room with ASP.NET and SignalR Service
1414

15-
Azure SignalR Service is based on [SignalR for ASP.NET Core 2.1](/aspnet/core/signalr/introduction?preserve-view=true&view=aspnetcore-2.1), which is **not** 100% compatible with ASP.NET SignalR. Azure SignalR Service re-implemented ASP.NET SignalR data protocol based on the latest ASP.NET Core technologies. When using Azure SignalR Service for ASP.NET SignalR, some ASP.NET SignalR features are no longer supported, for example, Azure SignalR does not replay messages when the client reconnects. Also, the Forever Frame transport and JSONP are not supported. Some code changes and proper version of dependent libraries are needed to make ASP.NET SignalR application work with SignalR Service.
15+
Azure SignalR Service is based on [SignalR for ASP.NET Core 2.1](/aspnet/core/signalr/introduction?preserve-view=true&view=aspnetcore-2.1), which is **not** 100% compatible with ASP.NET SignalR. Azure SignalR Service reimplemented ASP.NET SignalR data protocol based on the latest ASP.NET Core technologies. When you use Azure SignalR Service for ASP.NET SignalR, some ASP.NET SignalR features are no longer supported, for example, Azure SignalR doesn't replay messages when the client reconnects. Also, the Forever Frame transport and JSONP aren't supported. Some code changes and proper version of dependent libraries are needed to make ASP.NET SignalR application work with SignalR Service.
1616

1717
Refer to the [version differences doc](/aspnet/core/signalr/version-differences?preserve-view=true&view=aspnetcore-3.1) for a complete list of feature comparison between ASP.NET SignalR and ASP.NET Core SignalR.
1818

19-
In this quickstart, you will learn how to get started with the ASP.NET and Azure SignalR Service for a similar [Chat Room application](./signalr-quickstart-dotnet-core.md).
19+
In this quickstart, you learn how to get started with the ASP.NET and Azure SignalR Service for a similar [Chat Room application](./signalr-quickstart-dotnet-core.md).
2020

2121

2222
[!INCLUDE [quickstarts-free-trial-note](../../includes/quickstarts-free-trial-note-dotnet.md)]
@@ -37,7 +37,7 @@ Having issues? Try the [troubleshooting guide](signalr-howto-troubleshoot-guide.
3737

3838
[!INCLUDE [Create instance](includes/signalr-quickstart-create-instance.md)]
3939

40-
*Serverless* mode is not supported for ASP.NET SignalR applications. Always use *Default* or *Classic* for the Azure SignalR Service instance.
40+
*Serverless* mode isn't supported for ASP.NET SignalR applications. Always use *Default* or *Classic* for the Azure SignalR Service instance.
4141

4242
You can also create Azure resources used in this quickstart with [Create a SignalR Service script](scripts/signalr-cli-create-service.md).
4343

@@ -108,7 +108,7 @@ Having issues? Try the [troubleshooting guide](signalr-howto-troubleshoot-guide.
108108
> [!IMPORTANT]
109109
> Deleting a resource group is irreversible and that the resource group and all the resources in it are permanently deleted. Make sure that you do not accidentally delete the wrong resource group or resources. If you created the resources for hosting this sample inside an existing resource group that contains resources you want to keep, you can delete each resource individually from their respective blades instead of deleting the resource group.
110110
111-
Sign in to the [Azure portal](https://portal.azure.com) and click **Resource groups**.
111+
Sign in to the [Azure portal](https://portal.azure.com) and select **Resource groups**.
112112
113113
In the **Filter by name...** textbox, type the name of your resource group. The instructions for this quickstart used a resource group named *SignalRTestResources*. On your resource group in the result list, click **...** then **Delete resource group**.
114114

articles/azure-web-pubsub/tutorial-build-chat.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ Copy the fetched **ConnectionString** and it's used later in this tutorial as th
6363

6464
## Create the application
6565

66-
In Azure Web PubSub, there are two roles, server and client. This concept is similar to the server and client roles in a web application. Server is responsible for managing the clients, listen, and respond to client messages, while client's role is to send user's messages to server, and receive messages from server and visualize them to end user.
66+
In Azure Web PubSub, there are two roles, server and client. This concept is similar to the server and client roles in a web application. Server is responsible to manage the clients, listen, and respond to client messages. Client is responsible to send and receive user's messages from server and visualize them for end user.
6767

6868
In this tutorial, we build a real-time chat web application. In a real web application, server's responsibility also includes authenticating clients and serving static web pages for the application UI.
6969

@@ -351,7 +351,7 @@ We use the [Javalin](https://javalin.io/) web framework to host the web pages an
351351
}
352352
```
353353
354-
Depending on your setup, you might need to explicitly set the language level to Java 8. This can be done in the pom.xml. Add the following snippet:
354+
Depending on your setup, you might need to explicitly set the language level to Java 8. This step can be done in the pom.xml. Add the following snippet:
355355
```xml
356356
<build>
357357
<plugins>
@@ -557,7 +557,7 @@ app.use(handler.getMiddleware());
557557
In the above code, we simply print a message to console when a client is connected. You can see we use `req.context.userId` so we can see the identity of the connected client.
558558
559559
# [Java](#tab/java)
560-
For now, you need to implement the event handler by your own in Java, the steps are straight forward following [the protocol spec](./reference-cloud-events.md) and illustrated below.
560+
For now, you need to implement the event handler by your own in Java, the steps are straight forward following [the protocol spec](./reference-cloud-events.md) and illustrated in the below list:
561561
562562
1. Add HTTP handler for the event handler path, let's say `/eventhandler`.
563563
@@ -665,7 +665,7 @@ Implement the `OnMessageReceivedAsync()` method in `Sample_ChatApp`.
665665
}
666666
```
667667
668-
This event handler uses `WebPubSubServiceClient.SendToAllAsync()` to broadcast the received message to all clients. You can see in the end we returned `UserEventResponse`, which contains a message directly to the caller and make the WebHook request success. If you have extra logic to validate and would like to break this call, you can throw an exception here. The middleware delivers the exception message to service and service drops current client connection. Don't forget to include the `using Microsoft.Azure.WebPubSub.Common;` statement at the beginning of the `Program.cs` file.
668+
This event handler uses `WebPubSubServiceClient.SendToAllAsync()` to broadcast the received message to all clients. You can see in the end we returned `UserEventResponse`, which contains a message directly to the caller and make the WebHook request success. If you have extra logic to validate and would like to break this call, you can throw an exception here. The middleware delivers the exception message to service and service drops current client connection. Don't forget to include the `using Microsoft.Azure.WebPubSub.Common;` statement at the defining of the `Program.cs` file.
669669
670670
2. Update `index.html` to add the logic to send message from user to server and display received messages in the page.
671671
@@ -730,7 +730,7 @@ The complete code sample of this tutorial can be found [here][code-csharp-net6],
730730
731731
This event handler uses `WebPubSubServiceClient.sendToAll()` to broadcast the received message to all clients.
732732
733-
You can see `handleUserEvent` also has a `res` object where you can send message back to the event sender. Here we simply call `res.success()` to make the WebHook return 200 (note this call is required even you don't want to return anything back to client, otherwise the WebHook never returns and client connection is closed).
733+
You can see `handleUserEvent` also has a `res` object where you can send message back to the event sender. Here we simply call `res.success()` to make the WebHook return 200 (note this call is required even you don't want to return anything back to client, otherwise the WebHook never returns and client connection closes).
734734
735735
2. Update `index.html` to add the logic to send message from user to server and display received messages in the page.
736736

articles/azure-web-pubsub/tutorial-permission.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ ms.date: 11/01/2021
1010

1111
# Tutorial: Add authentication and permissions to your application when using Azure Web PubSub
1212

13-
In [Build a chat app](./tutorial-build-chat.md), you learned how to use WebSocket APIs to send and receive data with Azure Web PubSub. You might have noticed that, for simplicity, it doesn't require any authentication. Though Azure Web PubSub requires an access token to be connected, the `negotiate` API used in the tutorial to generate the access token doesn't need authentication. Anyone can call this API to get an access token.
13+
In [Build a chat app](./tutorial-build-chat.md), you learned how to use WebSocket APIs to send and receive data with Azure Web PubSub. You notice that, for simplicity, it doesn't require any authentication. Though Azure Web PubSub requires an access token to be connected, the `negotiate` API used in the tutorial to generate the access token doesn't need authentication. Anyone can call this API to get an access token.
1414

1515
In a real-world application, you typically want the user to sign in first, before they can use your application. In this tutorial, you learn how to integrate Web PubSub with the authentication and authorization system of your application, to make it more secure.
1616

@@ -40,7 +40,7 @@ First, add GitHub authentication to the chat room so the user can use a GitHub a
4040
npm install --save passport-github2
4141
```
4242

43-
1. Enable GitHub authentication by adding the following code to `server.js`:
43+
1. Find the `server.js` file in your directory and enable GitHub authentication by adding the following code to `server.js`:
4444

4545
```javascript
4646
const app = express();
@@ -81,7 +81,7 @@ First, add GitHub authentication to the chat room so the user can use a GitHub a
8181
The preceding code uses [Passport.js](http://www.passportjs.org/) to enable GitHub authentication. Here's a simple illustration of how it works:
8282
8383
1. `/auth/github` redirects to github.com for sign-in.
84-
1. After you sign in, GitHub redirects you to `/auth/github/callback` with a code for your application to complete the authentication. (To see how the profile returned from GitHub is verified and persisted in the server, see the verify callback in `passport.use()`.)
84+
1. After you sign in, GitHub redirects you to `/auth/github/callback` with a code for your application to complete the authentication. (To see how the profile returned from GitHub is verified and persisted in the server, see the verified callback in `passport.use()`.)
8585
1. After authentication is completed, you're redirected to the homepage (`/`) of the site.
8686
8787
For more details about GitHub OAuth and Passport.js, see the following articles:
@@ -142,11 +142,11 @@ First, add GitHub authentication to the chat room so the user can use a GitHub a
142142
});
143143
```
144144
145-
Now rerun the server, and you'll see a "not authorized" message for the first time you open the chat room. Select the sign-in link to sign in, and then you'll see it works as before.
145+
Now rerun the server, and you see a "not authorized" message for the first time you open the chat room. Select the sign-in link to sign in, and then you see it works as before.
146146
147147
## Work with permissions
148148
149-
In the previous tutorials, you learned to use `WebSocket.send()` to directly publish messages to other clients by using subprotocol. In a real application, you might not want the client to be able to publish or subscribe to any group without permission control. In this section, you'll see how to control clients by using the permission system of Web PubSub.
149+
In the previous tutorials, you learned to use `WebSocket.send()` to directly publish messages to other clients by using subprotocol. In a real application, you might not want the client to be able to publish or subscribe to any group without permission control. In this section, you see how to control clients by using the permission system of Web PubSub.
150150
151151
In Web PubSub, a client can perform the following types of operations with subprotocol:
152152
@@ -161,7 +161,7 @@ Sending an event to the server is the default operation of the client. No protoc
161161
162162
For permission to join a group, the client still needs to join the group by using the "join group" message after it gets the permission. Alternatively, the server can use an API to add the client to a group, even if it doesn't have the join permission.
163163
164-
Now let's use this permission system to add a new feature to the chat room. You'll add a new type of user called *administrator* to the chat room. You'll allow the administrator to send system messages (messages that start with "[SYSTEM]") directly from the client.
164+
Now let's use this permission system to add a new feature to the chat room. You add a new type of user called *administrator* to the chat room. You allow the administrator to send system messages (messages that start with "[SYSTEM]") directly from the client.
165165
166166
First, you need to separate system and user messages into two different groups so you can control their permissions separately.
167167
@@ -264,9 +264,9 @@ app.get('/negotiate', async (req, res) => {
264264
});
265265
```
266266
267-
Now run `node server <admin-id>`. You'll see that you can send a system message to every client when you sign in as `<admin-id>`.
267+
Now run `node server <admin-id>`. You see that you can send a system message to every client when you sign in as `<admin-id>`.
268268
269-
But if you sign in as a different user, when you select **system message**, nothing happens. You might expect the service to give you an error to let you know the operation isn't allowed. To provide this feedback, you can set `ackId` when you're publishing the message. Whenever `ackId` is specified, Web PubSub will return a message with a matching `ackId` to indicate whether the operation has succeeded or not.
269+
But if you sign in as a different user, when you select **system message**, nothing happens. You might expect the service to give you an error to let you know the operation isn't allowed. To provide this feedback, you can set `ackId` when you're publishing the message. Whenever `ackId` is specified, Web PubSub returns a message with a matching `ackId` to indicate whether the operation has succeeded or not.
270270
271271
Change the code of sending a system message to the following code:
272272
@@ -297,7 +297,7 @@ ws.onmessage = event => {
297297
};
298298
```
299299
300-
Now rerun the server, and sign in as a different user. You'll see an error message when you're trying to send a system message.
300+
Now rerun the server, and sign in as a different user. You see an error message when you're trying to send a system message.
301301
302302
The complete code sample of this tutorial can be found on [GitHub][code].
303303

0 commit comments

Comments
 (0)