Skip to content

Commit bf470d9

Browse files
committed
more changes to clarify setup and cmd shell limitations
1 parent 0be9ba9 commit bf470d9

File tree

1 file changed

+36
-8
lines changed

1 file changed

+36
-8
lines changed

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

Lines changed: 36 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,16 @@ Azure Web PubSub helps you manage WebSocket clients. This quickstart shows you h
1818
## Prerequisites
1919

2020
- An Azure subscription, if you don't have one, create a [free account](https://azure.microsoft.com/free/?WT.mc_id=A261C142F).
21-
- Either a Bash or PowerShell command shell.
21+
- a Bash and PowerShell command shell. The Python, Javascript and Java samples require a Bash command shell.
2222
- A file editor such as VSCode.
2323
- Azure CLI: [install the Azure CLI](/cli/azure/install-azure-cli)
2424

2525
If creating the project on a local machine, you'll need to install the dependencies for the language you're using:
2626

2727
# [C#](#tab/csharp)
2828

29+
Install both the .NET Core SDK and the `aspnetcore` and dotnet runtime.
30+
2931
[.NET Core](https://dotnet.microsoft.com/download)
3032

3133
# [JavaScript](#tab/javascript)
@@ -38,15 +40,15 @@ If creating the project on a local machine, you'll need to install the dependenc
3840

3941
# [Java](#tab/java)
4042

41-
* [Java Development Kit (JDK)](/java/openjdk/install/).
43+
* [Java Development Kit (JDK)](/java/openjdk/install/)
4244
* [Apache Maven](https://maven.apache.org/download.cgi)
4345

4446
---
4547

4648

4749
## 1. Setup
4850

49-
To sign in to Azure from the CLI, run the following command and follow the prompts to complete the authentication process.
51+
To sign in to Azure from the CLI, run the following command and follow the prompts to complete the authentication process. If you are using Cloud Shell it is not necessary to sign in.
5052

5153
```azurecli
5254
az login
@@ -64,6 +66,10 @@ Next, install or update the Azure Web PubSub extension for the CLI if it wasn't
6466
az extension add --name webpubsub --upgrade
6567
```
6668

69+
70+
## 1. Create a resource group
71+
72+
6773
Set the following environment variables. Replace the \<placeholder\> with a unique Web PubSub name.
6874

6975
# [Bash](#tab/bash)
@@ -74,6 +80,7 @@ LOCATION="EastUS"
7480
WEB_PUBSUB_NAME="<your-unique-name>"
7581
```
7682

83+
```azurecli
7784
# [Azure PowerShell](#tab/azure-powershell)
7885
7986
```azurepowershell
@@ -136,13 +143,13 @@ Save the service's connection string. The connection string is used by the serv
136143
# [Bash](#tab/bash)
137144

138145
```azurecli
139-
connection_string=$(az webpubsub key show --name $WEB_PUBSUB_NAME --resource-group $RESOURCE_GROUP --query primaryConnectionString)
146+
az webpubsub key show --name $WEB_PUBSUB_NAME --resource-group $RESOURCE_GROUP --query primaryConnectionString
140147
```
141148

142149
# [Azure PowerShell](#tab/azure-powershell)
143150

144151
```azurepowershell
145-
$connection_string = (az webpubsub key show --name $WebPubSubName --resource-group $ResourceGroupName --query primaryConnectionString)
152+
az webpubsub key show --name $WebPubSubName --resource-group $ResourceGroupName --query primaryConnectionString
146153
```
147154

148155
---
@@ -183,12 +190,29 @@ The connection to the Web PubSub service is established when you see a JSON mess
183190

184191
## 4. Publish messages using service SDK
185192

186-
You'll use the Azure Web PubSub SDK to publish a message to all the clients connected to the hub.
193+
You'll use the Azure Web PubSub SDK to publish a message to all the clients connected to the hub.
194+
You can choose between C#, JavaScript, Python and Java. The dependencies for each language are installed in the steps for that language. Note that Python, JavaScript and Java require a bash shell to run the commands in this quickstart.
187195

188196
### Set up the project to publish messages
189197

190-
ou will need to open a new command shell for this project.
191-
Now, select the language for your project. Note that the dependencies for each language are installed in the steps for that language.
198+
1. Open a new command shell for this project.
199+
1. Save the connection string from the client shell:
200+
201+
# [Bash](#tab/bash)
202+
203+
```azurecli
204+
Connection_String="<your_connection_string>"
205+
```
206+
207+
# [Azure PowerShell](#tab/azure-powershell)
208+
209+
```azurepowershell
210+
$connection_string = "<your_connection_string>"
211+
```
212+
213+
---
214+
215+
1. Now, select the language for your project.
192216
193217
# [C#](#tab/csharp)
194218
@@ -419,10 +443,14 @@ Now, select the language for your project. Note that the dependencies for each
419443
420444
You can delete the resources that you created in this quickstart by deleting the resource group that contains them.
421445
446+
# [Bash](#tab/bash)
447+
422448
```azurecli
423449
az group delete --name $RESOURCE_GROUP --yes
424450
```
425451

452+
# [Azure PowerShell](#tab/azure-powershell)
453+
d
426454
```azurepowershell
427455
az group delete --name $ResourceGroup --yes
428456
```

0 commit comments

Comments
 (0)