Skip to content

Commit 547cd3f

Browse files
committed
build and code fixes
1 parent 42fd7b0 commit 547cd3f

File tree

3 files changed

+56
-39
lines changed

3 files changed

+56
-39
lines changed

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

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,30 +7,30 @@ manager: mcclean
77
ms.custom: devx-track-azurecli
88
---
99

10-
## Azure CLI Setup for local development
10+
## Azure CLI setup for local development
1111

1212
Follow these steps to set up the Azure CLI and your project environment.
1313

14-
1. Upgrade to the latest version of the Azure CLI.
14+
1. Upgrade to the latest version of the Azure CLI.
1515

16-
```bash
17-
az upgrade
18-
```
16+
```bash
17+
az upgrade
18+
```
1919

2020
1. Install the Azure CLI extension for Web PubSub.
2121

22-
```bash
23-
az extension add --name webpubsub
24-
```
22+
```bash
23+
az extension add --name webpubsub
24+
```
2525

2626
1. Sign in to the Azure CLI. Following the prompts, enter your Azure credentials.
2727

28-
```bash
29-
az login
30-
```
28+
```bash
29+
az login
30+
```
3131

32-
1. Create a resource group.
32+
1. Create a resource group.
3333

34-
```bash
35-
az group create --name myResourceGroup --location eastus
36-
```
34+
```bash
35+
az group create --name myResourceGroup --location eastus
36+
```

articles/azure-web-pubsub/quickstart-use-sdk.md

Lines changed: 38 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,29 @@ Azure Web PubSub helps you manage WebSocket clients. This quickstart shows you h
2222
- A file editor such as VSCode.
2323
- Azure CLI: [install the Azure CLI](/cli/azure/install-azure-cli)
2424

25+
If creating the project on a local machine, you'll need to install the dependencies for the language you're using:
26+
27+
# [C#](#tab/csharp)
28+
29+
[.NET Core](https://dotnet.microsoft.com/download)
30+
31+
# [JavaScript](#tab/javascript)
32+
33+
[Node.js](https://nodejs.org)
34+
35+
# [Python](#tab/python)
36+
37+
[Python](https://www.python.org/)
38+
39+
# [Java](#tab/java)
40+
41+
* [Java Development Kit (JDK)](/java/openjdk/install/).
42+
* [Apache Maven](https://maven.apache.org/download.cgi)
43+
44+
---
2545

26-
## Setup
46+
47+
## 1. Setup
2748

2849
To sign in to Azure from the CLI, run the following command and follow the prompts to complete the authentication process.
2950

@@ -50,15 +71,15 @@ Set the following environment variables. Replace the \<placeholder\> with a uni
5071
```azurecli
5172
RESOURCE_GROUP="webpubsub-resource-group"
5273
LOCATION="EastUS"
53-
WEB_PUBSUB_NAME=<your-unique-name>
74+
WEB_PUBSUB_NAME="<your-unique-name>"
5475
```
5576

5677
# [Azure PowerShell](#tab/azure-powershell)
5778

5879
```azurepowershell
5980
$ResourceGroupName = 'webpubsub-resource-group'
6081
$Location = 'EastUS'
61-
$WebPubSubName = <YourUniqueName>
82+
$WebPubSubName = `<YourUniqueName>`
6283
```
6384

6485
---
@@ -76,12 +97,12 @@ az group create \
7697
# [Azure PowerShell](#tab/azure-powershell)
7798

7899
```azurepowershell
79-
az group create -Location $Location -Name $ResourceGroupName
100+
az group create --location $Location --name $ResourceGroupName
80101
```
81102

82103
---
83104

84-
## Deploy a Web PubSub service instance
105+
## 2. Deploy a Web PubSub service instance
85106

86107
Use the `az webpubsub create` command to create and deploy a Web PubSub service instance.
87108

@@ -91,7 +112,7 @@ Use the `az webpubsub create` command to create and deploy a Web PubSub service
91112
az webpubsub create \
92113
--name $WEB_PUBSUB_NAME \
93114
--resource-group $RESOURCE_GROUP \
94-
--location LOCATION \
115+
--location $LOCATION \
95116
--sku Free_F1
96117
```
97118

@@ -102,7 +123,7 @@ az webpubsub create `
102123
--name $WebPubSubName `
103124
--location $Location `
104125
--resource-group $ResourceGroupName `
105-
--sku Free_F1
126+
--sku Free_F1 `
106127
```
107128

108129
---
@@ -115,7 +136,7 @@ Save the service's connection string. The connection string is used by the serv
115136
# [Bash](#tab/bash)
116137

117138
```azurecli
118-
$connection_string=(az webpubsub key show --name $WEB_PUBSUB_NAME --resource-group $RESOURCE_GROUP --query primaryConnectionString)
139+
connection_string=$(az webpubsub key show --name $WEB_PUBSUB_NAME --resource-group $RESOURCE_GROUP --query primaryConnectionString)
119140
```
120141

121142
# [Azure PowerShell](#tab/azure-powershell)
@@ -126,7 +147,7 @@ $connection_string = (az webpubsub key show --name $WebPubSubName --resource-gro
126147

127148
---
128149

129-
## Connect a client to the service instance
150+
## 3. Connect a client to the service instance
130151

131152
Create a Web PubSub client. The client maintains a connection to the service until it's terminated.
132153

@@ -148,8 +169,8 @@ az webpubsub client start \
148169
az webpubsub client start `
149170
--name $WebPubSubName `
150171
--resource-group $ResourceGroupName `
151-
--hub-name "myHub1" `
152-
--user-id "user1"
172+
--hub-name 'myHub1' `
173+
--user-id 'user1'
153174
```
154175

155176
---
@@ -160,13 +181,10 @@ The connection to the Web PubSub service is established when you see a JSON mess
160181
{"type":"system","event":"connected","userId":"user1","connectionId":"<your_unique_connection_id>"}
161182
```
162183

163-
## Publish messages using service SDK
164-
165-
You'll create a client that uses the Azure Web PubSub SDK to publish a message to all connected clients.
184+
## 4. Publish messages using service SDK
166185

167-
### Set up the project to publish messages
186+
You'll create a client that uses the Azure Web PubSub SDK to publish a message to all connected clients. For this project, you'll need to open another command shell.
168187

169-
Start by opening another command shell.
170188
Select the language for your project. The dependencies for each language are installed in the steps for that language.
171189

172190
# [C#](#tab/csharp)
@@ -334,8 +352,7 @@ Select the language for your project. The dependencies for each language are in
334352
</dependency>
335353
```
336354
337-
1. Use the Azure Web PubSub SDK to publish a message to the service.
338-
1. Go to the */src/main/java/com/webpubsub/quickstart* directory.
355+
1. Go to the *src/main/java/com/webpubsub/quickstart* directory.
339356
1. Replace the contents in the *App.java* file with the following code:
340357
341358
```java
@@ -367,9 +384,9 @@ Select the language for your project. The dependencies for each language are in
367384
368385
```
369386
370-
This code uses the Azure Web PubSub SDK to publish a message to the service. The `service.sendToAll()` call simply sends a message to all connected clients in a hub.
387+
This code uses the Azure Web PubSub SDK to publish a message to the service. The `service.sendToAll()` call sends a message to all connected clients in a hub.
371388
372-
1. Go to the directory containing the *pom.xml* file and compile the project by using the following `mvn` command.
389+
1. Return t the *webpubsub-quickstart-publisher* directory containing the *pom.xml* file and compile the project by using the following `mvn` command.
373390
374391
```console
375392
mvn compile
@@ -384,7 +401,7 @@ Select the language for your project. The dependencies for each language are in
384401
1. Run the following `mvn` command to execute the app to publish a message to the service:
385402
386403
```console
387-
mvn exec:java -Dexec.mainClass="com.webpubsub.quickstart.App" -Dexec.cleanupDaemonThreads=false -Dexec.args="$connection_string 'myHub1' 'Hello World'"
404+
mvn exec:java -Dexec.mainClass="com.webpubsub.quickstart.App" -Dexec.cleanupDaemonThreads=false -Dexec.args=" '$connection_string' 'myHub1' 'Hello World'"
388405
```
389406
390407
1. The previous command shell containing the Web PubSub client shows the received message.

articles/azure-web-pubsub/tutorial-pub-sub-messages.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ If creating the project on a local machine, you'll need to install the dependenc
6161

6262
---
6363

64-
## Create an Azure Web PubSub instance
64+
## 1. Create an Azure Web PubSub instance
6565

6666

6767
### Create a Web PubSub instance
@@ -371,7 +371,7 @@ Clients connect to the Azure Web PubSub service through the standard WebSocket p
371371
372372
---
373373
374-
## Publish messages using service SDK
374+
## 2. Publish messages using service SDK
375375
376376
Create a publisher using the Azure Web PubSub SDK to publish a message to the connected client. For this project, you'll need to open another command shell.
377377
@@ -603,7 +603,7 @@ az group delete --name <CloudShellResourceGroup> --yes
603603
604604
```
605605
606-
>[CAUTION]
606+
>[!CAUTION]
607607
> Deleting resource groups will delete all resources, including resources created outside the scope of this tutorial.
608608
609609
## Next steps

0 commit comments

Comments
 (0)