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/signalr-tutorial-authenticate-azure-functions.md
+69-57Lines changed: 69 additions & 57 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,6 +19,18 @@ In this step-by-step tutorial, you build a chat room with authentication and pri
19
19
-[Azure Storage](https://azure.microsoft.com/services/storage/?WT.mc_id=serverlesschatlab-tutorial-antchu): Storage service that Azure Functions requires.
20
20
-[Azure App Service](https://azure.microsoft.com/products/app-service/): Service that provides user authentication.
21
21
22
+
# [Model v4](#tab/nodejs-v4)
23
+
24
+
> [!NOTE]
25
+
> You can get the code mentioned in this article from [GitHub](https://github.com/aspnet/AzureSignalR-samples/blob/90523e17ee5fec184a197b143bb5070bc6d4f312/samples/ServerlessChatWithAuth/v4-model/).
26
+
27
+
# [Isolated process](#tab/isolated-process)
28
+
29
+
> [!NOTE]
30
+
> You can get the code mentioned in this article from [GitHub](https://github.com/aspnet/AzureSignalR-samples/blob/90523e17ee5fec184a197b143bb5070bc6d4f312/samples/ServerlessChatWithAuth/v3-model/).
31
+
32
+
---
33
+
22
34
## Prerequisites
23
35
24
36
- An Azure account with an active subscription. If you don't have one, you can [create one for free](https://azure.microsoft.com/free/).
@@ -132,86 +144,86 @@ When the chat app first opens in the browser, it requires valid connection crede
132
144
133
145
1. From the root project folder, create the `negotiate` function from a built-in template by using the following command:
134
146
135
-
```bash
136
-
func new --template "HTTP trigger" --name negotiate
137
-
```
147
+
```bash
148
+
func new --template "HTTP trigger" --name negotiate
149
+
```
138
150
139
151
1. Open _src/functions/negotiate.js_, update the content as follows:
The function contains an HTTP trigger binding to receive requests from SignalR clients. The function also contains a SignalR input binding to generate valid credentials for a client to connect to an Azure SignalR Service hub named `default`.
174
+
The functioncontains an HTTP trigger binding to receive requests from SignalR clients. The functionalso contains a SignalR input binding to generate valid credentials for a client to connect to an Azure SignalR Service hub named `default`.
163
175
164
-
This function takes the SignalR connection information from the input binding and returns it to the client in the HTTP response body..
176
+
This functiontakes the SignalR connection information from the input binding and returns it to the client in the HTTP response body..
165
177
166
-
There's no `userId` property in the `signalRConnectionInfo` binding for local development. You'll add it later to set the username of a SignalR connection when you deploy the function app to Azure.
178
+
There's no `userId` property in the `signalRConnectionInfo` binding for local development. You'll add it later to set the username of a SignalR connection when you deploy the functionapp to Azure.
167
179
168
180
# [Model v3](#tab/nodejs-v3)
169
181
170
182
1. Open _negotiate/function.json_ to view the functionbinding configuration.
171
183
172
-
The function contains an HTTP trigger binding to receive requests from SignalR clients. The function also contains a SignalR input binding to generate valid credentials for a client to connect to an Azure SignalR Service hub named `default`.
184
+
The functioncontains an HTTP trigger binding to receive requests from SignalR clients. The functionalso contains a SignalR input binding to generate valid credentials for a client to connect to an Azure SignalR Service hub named `default`.
There's no `userId` property in the `signalRConnectionInfo` binding for local development. You'll add it later to set the username of a SignalR connection when you deploy the function app to Azure.
214
+
There's no `userId` property in the `signalRConnectionInfo` binding for local development. You'll add it later to set the username of a SignalR connection when you deploy the functionapp to Azure.
203
215
204
216
1. Close the _negotiate/function.json_ file.
205
217
206
218
1. Open _negotiate/index.js_ to view the body of the function:
This function takes the SignalR connection information from the input binding and returns it to the client in the HTTP response body. The SignalR client uses this information to connect to the Azure SignalR Service instance.
226
+
This functiontakes the SignalR connection information from the input binding and returns it to the client in the HTTP response body. The SignalR client uses this information to connect to the Azure SignalR Service instance.
0 commit comments