Skip to content

Commit 48d4972

Browse files
committed
further edits
1 parent 76aa5ec commit 48d4972

File tree

2 files changed

+58
-68
lines changed

2 files changed

+58
-68
lines changed

articles/azure-signalr/signalr-quickstart-azure-functions-javascript.md

Lines changed: 32 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,17 @@ ms.custom: devx-track-js, mode-api
1818
1919
## Prerequisites
2020

21-
- A code editor, such as [Visual Studio Code](https://code.visualstudio.com/).
22-
- An Azure account with an active subscription. If you don't already have an Azure account, [create an account for free](https://azure.microsoft.com/free/?ref=microsoft.com&utm_source=microsoft.com&utm_medium=docs&utm_campaign=visualstudio).
23-
- [Azure Functions Core Tools](https://github.com/Azure/azure-functions-core-tools#installing), version 2 or above. Used to run Azure Function apps locally.
24-
- [Node.js](https://nodejs.org/en/download/), See supported node.js versions in the [Azure Functions JavaScript developer guide](../azure-functions/functions-reference-node.md#node-version).
25-
- SignalR binding needs Azure Storage, but you can use a local storage emulator when a function is running locally. Install the open source storage emulator [Azurite](../storage/common/storage-use-azurite.md).
26-
27-
The examples should work with other versions of Node.js, for more information, see [Azure Functions runtime versions documentation](../azure-functions/functions-versions.md#languages).
28-
2921
This quickstart can be run on macOS, Windows, or Linux.
3022

23+
| Prerequisite | Description |
24+
| --- | --- |
25+
| An Azure subsription |If you don't have an [Azure subscription](../articles/guides/developer/azure-developer-guide.md#understanding-accounts-subscriptions-and-billing), create an [Azure free account](https://azure.microsoft.com/free/?ref=microsoft.com&utm_source=microsoft.com&utm_medium=docs&utm_campaign=visualstudio)|
26+
| A code editor | You'll need a code editor such as [Visual Studio Code](https://code.visualstudio.com/). |
27+
| [Azure Functions Core Tools](https://github.com/Azure/azure-functions-core-tools#installing)| Requires version 2.7.1505 or higher to run Python Azure Function apps locally.|
28+
|[Node.js](https://nodejs.org/en/download/)| See supported node.js versions in the [Azure Functions JavaScript developer guide](../azure-functions/functions-reference-node.md#node-version).|
29+
| [Azurite](../storage/common/storage-use-azurite.md)| SignalR binding needs Azure Storage. You can use a local storage emulator when a function is running locally. |
30+
| [Azure CLI](https://docs.microsoft.com/cli/azure/install-azure-cli)| Optionally, you can use the Azure CLI to create an Azure SignalR Service instance. |
31+
3132
## Create an Azure SignalR Service instance
3233

3334
[!INCLUDE [Create instance](includes/signalr-quickstart-create-instance.md)]
@@ -36,30 +37,28 @@ This quickstart can be run on macOS, Windows, or Linux.
3637

3738
Make sure you have Azure Functions Core Tools installed.
3839

39-
1. Open a command line
40-
1. Create an empty directory and then change to it.
41-
1. Run the Azure Functions `func init` command to initialize a new project:
40+
1. Open a command line.
41+
1. Create project directory and then change to it.
42+
1. Run the Azure Functions `func init` command to initialize a new project.
4243

4344
```bash
4445
# Initialize a function project
4546
func init --worker-runtime javascript
4647
```
4748

48-
## Create the functions
49+
## Create the project functions
4950

50-
After you initialize a project, you need to create functions. In this sample, we need to create three functions:
51+
After you initialize a project, you need to create functions. This project requires three functions:
5152

52-
- `index`: hosts a web page for a client
53-
- `negotiate`: allows client to get an access token
54-
- `broadcast`: broadcasts messages to all clients. In the app, the time trigger broadcasts messages periodically
53+
- `index`: Hosts a web page for a client.
54+
- `negotiate`: Allows a client to get an access token.
55+
- `broadcast`: Uses a time trigger to periodically broadcast messages to all clients.
5556

5657
When you run the `func new` command from the root directory of the project, the Azure Functions Core Tools creates the function source files storing them in a folder with the function name. You'll edit the files as necessary replacing the default code with the app code.
5758

5859
### Create the index function
5960

60-
61-
62-
1. Run the following command to create an `index` function.
61+
1. Run the following command to create the `index` function.
6362

6463
```bash
6564
func new -n index -t HttpTrigger
@@ -112,10 +111,9 @@ When you run the `func new` command from the root directory of the project, the
112111
}
113112
```
114113

115-
116114
### Create the negotiate function
117115

118-
1. Run the following command to create an `negotiate` function.
116+
1. Run the following command to create the `negotiate` function.
119117

120118
```bash
121119
func new -n negotiate -t HttpTrigger
@@ -152,12 +150,10 @@ When you run the `func new` command from the root directory of the project, the
152150
]
153151
}
154152
```
155-
156-
157153

158154
### Create a broadcast function.
159155

160-
1. Run the following command to create an `broadcast` function.
156+
1. Run the following command to create the `broadcast` function.
161157

162158
```bash
163159
func new -n broadcast -t TimerTrigger
@@ -186,7 +182,7 @@ When you run the `func new` command from the root directory of the project, the
186182
}
187183
```
188184

189-
1. Edit *broadcast/index.js* and replace the contents with the following code:
185+
1. Edit *broadcast/index.js* and replace the contents with the following code:
190186

191187
```javascript
192188
var https = require('https');
@@ -232,13 +228,14 @@ When you run the `func new` command from the root directory of the project, the
232228
}
233229
```
234230

235-
The client interface for this app is a web page. The `index` function reads HTML content from the *content/index.html* file.
231+
### Create the index.html file
232+
233+
The client interface for this app is a web page. The `index` function reads HTML content from the *content/index.html* file.
236234

237235
1. Create a folder called `content` in your project root folder.
238-
1. Create a new file *index.html* in the `content` folder.
236+
1. Create the file *content/index.html*.
239237
1. Copy the following content to the *content/index.html* file and save it:
240238

241-
242239
```html
243240
<html>
244241

@@ -267,17 +264,14 @@ The client interface for this app is a web page. The `index` function reads HTML
267264

268265
### Add the SignalR Service connection string to the function app settings
269266

270-
The last step is to set the connection string of the SignalR Service in Azure Function settings.
271-
272-
1. In the Azure portal, find the SignalR instance you deployed earlier by typing its name in the **Search** box. Select the instance to open it.
273-
274-
![Search for the SignalR Service instance](media/signalr-quickstart-azure-functions-csharp/signalr-quickstart-search-instance.png)
267+
The last step is to set the SignalR Service connection string in Azure Function app settings.
275268

269+
1. In the Azure portal, go to the SignalR instance you deployed earlier.
276270
1. Select **Keys** to view the connection strings for the SignalR Service instance.
277271

278-
![Screenshot that highlights the primary connection string.](media/signalr-quickstart-azure-functions-javascript/signalr-quickstart-keys.png)
272+
:::image type="content" source="media/signalr-quickstart-azure-functions-javascript/signalr-quickstart-keys.png" alt-text="Screenshot of Azure SignalR service Keys page.":::
279273

280-
1. Copy the primary connection string. And execute the command:
274+
1. Copy the primary connection string, and execute the command:
281275

282276
```bash
283277
func settings add AzureSignalRConnectionString "<signalr-connection-string>"
@@ -291,16 +285,16 @@ Start the Azurite storage emulator:
291285
azurite
292286
```
293287

294-
Run the Azure Function in the local environment:
288+
Run the Azure Function app in the local environment:
295289

296290
```bash
297291
func start
298292
```
299293

300294
> [!NOTE]
301-
> If you see an error like `There was an error performing a read operation on the Blob Storage Secret Repository`. Please ensure the 'AzureWebJobsStorage' setting in the *local.settings.json* file is set to `UseDevelopmentStorage=true`.
295+
> If you see an errors showing read errors on the blob storage, ensure the 'AzureWebJobsStorage' setting in the *local.settings.json* file is set to `UseDevelopmentStorage=true`.
302296
303-
After the Azure Function is running locally, go to `http://localhost:7071/api/index`. The page shows the current star count for the GitHub Azure/azure-signalr repository. When you star or unstar the repository in GitHub, you'll see the refreshed count on the page every few seconds.
297+
After the Azure Function is running locally, go to `http://localhost:7071/api/index`. The page displays the current star count for the GitHub Azure/azure-signalr repository. When you star or unstar the repository in GitHub, you'll see the refreshed count every few seconds.
304298

305299
Having issues? Try the [troubleshooting guide](signalr-howto-troubleshoot-guide.md) or [let us know](https://aka.ms/asrs/qscsharp)
306300

articles/azure-signalr/signalr-quickstart-azure-functions-python.md

Lines changed: 26 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -18,22 +18,21 @@ Get started with Azure SignalR Service by using Azure Functions and Python to bu
1818
1919
## Prerequisites
2020

21-
This quickstart can be run on macOS, Windows, or Linux.
21+
This quickstart can be run on macOS, Windows, or Linux. You willneed the following:
2222

23-
- You'll need a code editor such as [Visual Studio Code](https://code.visualstudio.com/).
24-
25-
- Install the [Azure Functions Core Tools](https://github.com/Azure/azure-functions-core-tools#installing) (version 2.7.1505 or higher) to run Python Azure Function apps locally.
26-
27-
- Azure Functions requires [Python 3.6+](https://www.python.org/downloads/). (See [Supported Python versions](../azure-functions/functions-reference-python.md#python-version).)
28-
29-
- SignalR binding needs Azure Storage, but you can use a local storage emulator when a function is running locally. You'll need to install and run the open source storage emulator [Azurite](../storage/common/storage-use-azurite.md).
30-
31-
[!INCLUDE [quickstarts-free-trial-note](../../includes/quickstarts-free-trial-note.md)]
23+
| Prerequisite | Description |
24+
| --- | --- |
25+
| An Azure subsription |If you don't have an [Azure subscription](../articles/guides/developer/azure-developer-guide.md#understanding-accounts-subscriptions-and-billing), create an [Azure free account](https://azure.microsoft.com/free/?ref=microsoft.com&utm_source=microsoft.com&utm_medium=docs&utm_campaign=visualstudio)|
26+
| A code editor | You'll need a code editor such as [Visual Studio Code](https://code.visualstudio.com/). |
27+
| [Azure Functions Core Tools](https://github.com/Azure/azure-functions-core-tools#installing)| Requires version 2.7.1505 or higher to run Python Azure Function apps locally.|
28+
| [Python 3.6+](https://www.python.org/downloads/)| Azure Functions requires Python 3.6+. See [Supported Python versions](../azure-functions/functions-reference-python.md#python-version). |
29+
| [Azurite](../storage/common/storage-use-azurite.md)| SignalR binding needs Azure Storage. You can use a local storage emulator when a function is running locally. |
30+
| [Azure CLI](https://docs.microsoft.com/cli/azure/install-azure-cli)| Optionally, you can use the Azure CLI to create an Azure SignalR Service instance. |
3231

3332
## Create an Azure SignalR Service instance
3433

3534
[!INCLUDE [Create instance](includes/signalr-quickstart-create-instance.md)]
36-
35+
3736
## Create the Azure Function project
3837

3938
Create a local Azure Function project.
@@ -49,19 +48,19 @@ Create a local Azure Function project.
4948

5049
## Create the functions
5150

52-
After you initialize a project, you need to create functions. In this sample, we need to create three functions:
51+
After you initialize a project, you need to create functions. This project requires three functions:
5352

54-
- `index`: hosts a web page for a client
55-
- `negotiate`: allows client to get an access token
56-
- `broadcast`: broadcasts messages to all clients. In the app, the time trigger broadcasts messages periodically
53+
- `index`: Hosts a web page for a client.
54+
- `negotiate`: Allows a client to get an access token.
55+
- `broadcast`: Uses a time trigger to periodically broadcast messages to all clients.
5756

58-
When you run the `func new` command from the root directory of the project, the Azure Functions Core Tools creates the function source files storing them in a folder with the function name. You'll edit the files as necessary replacing the default code with the app code.
57+
When you run the `func new` command from the root directory of the project, the Azure Functions Core Tools creates default function source files and stores them in a folder named after the function. You'll edit the files as necessary replacing the default code with the app code.
5958

6059
### Create the index function
6160

6261
You can use this sample function as a template for your own functions.
6362

64-
1. Run the following command to create an `index` function.
63+
1. Run the following command to create the `index` function.
6564

6665
```bash
6766
func new -n index -t HttpTrigger
@@ -105,7 +104,7 @@ You can use this sample function as a template for your own functions.
105104

106105
### Create the negotiate function
107106

108-
1. Run the following command to create an `negotiate` function.
107+
1. Run the following command to create the `negotiate` function.
109108

110109
```bash
111110
func new -n negotiate -t HttpTrigger
@@ -154,7 +153,7 @@ You can use this sample function as a template for your own functions.
154153

155154
### Create a broadcast function.
156155

157-
1. Run the following command to create an `broadcast` function.
156+
1. Run the following command to create the `broadcast` function.
158157

159158
```bash
160159
func new -n broadcast -t TimerTrigger
@@ -219,7 +218,7 @@ You can use this sample function as a template for your own functions.
219218
The client interface for this app is a web page. The `index` function reads HTML content from the *content/index.html* file.
220219

221220
1. Create a folder called `content` in your project root folder.
222-
1. Create a new file *index.html* in the `content` folder.
221+
1. Create the file *content/index.html*.
223222
1. Copy the following content to the *content/index.html* file and save it:
224223

225224
```html
@@ -250,17 +249,14 @@ The client interface for this app is a web page. The `index` function reads HTML
250249

251250
### Add the SignalR Service connection string to the function app settings
252251

253-
The last step is to set the connection string of the SignalR Service in Azure Function settings.
254-
255-
1. In the Azure portal, search for the SignalR Service instance you deployed earlier. Select the instance to open it.
256-
257-
![Search for the SignalR Service instance](media/signalr-quickstart-azure-functions-csharp/signalr-quickstart-search-instance.png)
252+
The last step is to set the SignalR Service connection string in Azure Function app settings.
258253

254+
1. In the Azure portal, go to the SignalR instance you deployed earlier.
259255
1. Select **Keys** to view the connection strings for the SignalR Service instance.
260256

261-
![Screenshot that highlights the primary connection string.](media/signalr-quickstart-azure-functions-javascript/signalr-quickstart-keys.png)
257+
:::image type="content" source="media/signalr-quickstart-azure-functions-javascript/signalr-quickstart-keys.png" alt-text="Screenshot of Azure SignalR service Keys page.":::
262258

263-
1. Copy the primary connection string, and then run the following command:
259+
1. Copy the primary connection string, and execute the command:
264260

265261
```bash
266262
func settings add AzureSignalRConnectionString "<signalr-connection-string>"
@@ -274,16 +270,16 @@ Start the Azurite storage emulator:
274270
azurite
275271
```
276272

277-
Run the Azure Function in the local environment:
273+
Run the Azure Function app in the local environment:
278274

279275
```bash
280276
func start
281277
```
282278

283279
> [!NOTE]
284-
> If you see an error like `There was an error performing a read operation on the Blob Storage Secret Repository`. Please ensure the 'AzureWebJobsStorage' setting in the *local.settings.json* file is set to `UseDevelopmentStorage=true`.
280+
> If you see an errors showing read errors on the blob storage, ensure the 'AzureWebJobsStorage' setting in the *local.settings.json* file is set to `UseDevelopmentStorage=true`.
285281

286-
After the Azure Function is running locally, go to `http://localhost:7071/api/index`. The page shows the current star count for the GitHub Azure/azure-signalr repository. When you star or unstar the repository in GitHub, you'll see the refreshed count on the page every few seconds.
282+
After the Azure Function is running locally, go to `http://localhost:7071/api/index`. The page displays the current star count for the GitHub Azure/azure-signalr repository. When you star or unstar the repository in GitHub, you'll see the refreshed count every few seconds.
287283
288284
[!INCLUDE [Cleanup](includes/signalr-quickstart-cleanup.md)]
289285

0 commit comments

Comments
 (0)