Skip to content

Commit 96ca116

Browse files
authored
Some minor changes
1 parent 9939cae commit 96ca116

File tree

1 file changed

+22
-6
lines changed

1 file changed

+22
-6
lines changed

articles/azure-web-pubsub/socketio-serverless-tutorial.md

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ This tutorial walks you through how to create a Web PubSub for Socket.IO service
1515

1616
Find full code samples that are used in this tutorial:
1717

18-
- [JavaScript Sample](https://github.com/Azure/azure-webpubsub/tree/main/sdk/webpubsub-socketio-extension/examples/chat-serverless-javascript)
18+
- [Socket.IO Serverless Sample](https://github.com/Azure/azure-webpubsub/tree/main/sdk/webpubsub-socketio-extension/examples/chat-serverless-javascript)
1919

2020
> [!IMPORTANT]
2121
> Default Mode needs a persistent server, you cannot integration Web PubSub for Socket.IO in default mode with Azure Function.
@@ -252,18 +252,24 @@ After code is prepared, following the instructions to run the sample.
252252

253253
### Set up Azure Storage for Azure Function
254254

255-
Azure Functions requires a storage account to work. Choose either of the two following options:
255+
Azure Functions requires a storage account to work even running in local. Choose either of the two following options:
256256

257-
* Run the free [Azure Storage Emulator](../storage/common/storage-use-azurite.md).
257+
* Run the free [Azurite emulator](../storage/common/storage-use-azurite.md).
258258
* Use the Azure Storage service. This may incur costs if you continue to use it.
259259

260260
#### [Local emulation](#tab/storage-azurite)
261261

262+
1. Install the Azureite
263+
264+
```bash
265+
npm install -g azurite
266+
```
267+
262268
1. Start the Azurite storage emulator:
263269

264-
```bash
265-
azurite -l azurite -d azurite\debug.log
266-
```
270+
```bash
271+
azurite -l azurite -d azurite\debug.log
272+
```
267273

268274
1. Make sure the `AzureWebJobsStorage` in *local.settings.json* set to `UseDevelopmentStorage=true`.
269275

@@ -291,6 +297,14 @@ func settings add WebPubSubForSocketIOConnectionString "<connection string>"
291297
az webpubsub hub create -n <resource name> -g <resource group> --hub-name hub --event-handler url-template="tunnel:///runtime/webhooks/socketio" user-event-pattern="*"
292298
```
293299

300+
The connection string can be get by the azure cli command
301+
302+
```azcli
303+
az webpubsub key show -g <resource group> -n <resource name>
304+
```
305+
306+
The output will contains `primaryConnectionString` and `secondaryConnectionString`, and either is available.
307+
294308
### Setup tunnel
295309

296310
In serverless mode, the service uses webhooks to trigger the function. When running the app locally, a crucial problem is let the service be able to access your local function endpoint.
@@ -309,6 +323,8 @@ npm install -g @azure/web-pubsub-tunnel-tool
309323
awps-tunnel run --hub hub --connection "<connection string>" --upstream http://127.0.0.1:7071
310324
```
311325

326+
The `--upstream` is the url that local Azure Function exposes. The port may be different and you can check the output when starting the function in the next step.
327+
312328
### Run Sample App
313329

314330
After tunnel tool is running, you can run the Function App locally:

0 commit comments

Comments
 (0)