Skip to content

Commit 7b10c69

Browse files
committed
Update Readme
1 parent d9c0321 commit 7b10c69

File tree

2 files changed

+43
-9
lines changed

2 files changed

+43
-9
lines changed

samples/EventGridIntegration/README.md

Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,20 @@
22

33
A step by step tutorial to build a chat room with real-time online counting using Azure Functions, Event Grid, App Service Authentication, and SignalR Service.
44

5+
- [Prerequisites](#prerequisites)
6+
- [Initialize the function app](#initialize-function-app)
7+
- [Deploy and run function app on Azure](#deploy-to-azure)
8+
- [Enable authentication on Azure](#enable-authentication)
9+
- [Build and run the sample locally](#build-locally)
10+
11+
<a name="prerequisites"></a>
512
## Prerequisites
613

714
The following software is required to build this tutorial.
815

9-
* [Git](https://git-scm.com/downloads)
1016
* [Node.js](https://nodejs.org/en/download/) (Version 10.x)
1117
* [.NET SDK](https://www.microsoft.com/net/download) (Version 2.x, required for Functions extensions)
1218
* [Azure Functions Core Tools](https://github.com/Azure/azure-functions-core-tools) (Version 2)
13-
* [Visual Studio Code](https://code.visualstudio.com/) (VS Code) with the following extensions
14-
* [Azure Functions](https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-azurefunctions) - work with Azure Functions in VS Code
15-
* [Live Server](https://marketplace.visualstudio.com/items?itemName=ritwickdey.LiveServer) - serve web pages locally for testing (Local running)
16-
* [ngrok](https://ngrok.com/) - Public URLs for exposing your local Event Grid trigger (Local running)
1719

1820
### Create an Azure SignalR Service instance
1921

@@ -41,15 +43,22 @@ An Azure Storage account is required by a function app using Event Grid trigger.
4143
az storage account create -n <storage-account-name> -g <resource-group-name> -l <location> --sku Standard_LRS --kind StorageV2
4244
```
4345

46+
<a name="initialize-function-app"></a>
4447
## Initialize the function app
4548

46-
### Configure application settings
49+
- Git clone the project and open the folder with VS Code
50+
51+
```bash
52+
git clone git@github.com:aspnet/AzureSignalR-samples.git
53+
54+
cd AzureSignalR-samples/samples/EventGridIntegration/javascript
55+
```
4756

48-
When running and debugging the Azure Functions runtime locally, application settings are read from **local.settings.json**. Update this file with the connection string of the SignalR Service instance that you created earlier.
57+
### Configure application settings
4958

50-
1. In the root folder of project, create a file named **local.settings.json** and open it.
59+
When running and debugging the Azure Functions runtime locally, application settings are read from **local.settings.json**. Also, you can upload there settings to remote when you try to deploy Function App to Azure. Update this file with the connection string of the SignalR Service instance that you created earlier.
5160

52-
1. Replace the file's contents with the following.
61+
1. Open the file **local.settings.json** and update the settings.
5362

5463
```json
5564
{
@@ -85,10 +94,13 @@ When running and debugging the Azure Functions runtime locally, application sett
8594

8695
1. Open the terminal and run `func extensions install` to install all the dependencies.
8796

97+
<a name="deploy-to-azure"></a>
8898
## Deploy and run function app on Azure
8999

90100
### Deploy function app to Azure
91101

102+
1. In the VS Code, install the [Azure Functions Extension](https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-azurefunctions).
103+
92104
1. Open the VS Code command palette (`Ctrl-Shift-P`, macOS: `Cmd-Shift-P`) and select **Azure Functions: Deploy to Function App**.
93105

94106
1. When prompted, provide the following information.
@@ -188,6 +200,7 @@ Although there is a CORS setting in **local.settings.json**, it is not propagate
188200

189201
![Overview of the application](media/overview.png)
190202

203+
<a name="enable-authentication"></a>
191204
## Enable authentication on Azure
192205

193206
### Enable App Service Authentication
@@ -240,8 +253,14 @@ App Service Authentication supports authentication with Azure Active Directory,
240253
241254
![Overview with auth](media/overview-with-auth.png)
242255
256+
<a name="build-locally"></a>
243257
## Build and run the sample locally
244258
259+
### Prerequisites
260+
261+
* [Live Server](https://marketplace.visualstudio.com/items?itemName=ritwickdey.LiveServer) - serve web pages locally for testing
262+
* [ngrok](https://ngrok.com/) - Public URLs for exposing your local Event Grid trigger
263+
245264
### Create an ngrok endpoint
246265
247266
When running Event Grid trigger locally, you need a tool to proxy events to your local endpoint like [ngrok](https://ngrok.com/). For more details about running Event Grid trigger locally, go to the [document](https://docs.microsoft.com/en-us/azure/azure-functions/functions-debug-event-grid-trigger-local)
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"IsEncrypted": false,
3+
"Values": {
4+
"AzureSignalRConnectionString": "<signalr-connection-string>",
5+
"WEBSITE_NODE_DEFAULT_VERSION": "10.14.1",
6+
"FUNCTIONS_WORKER_RUNTIME": "node",
7+
"AzureWebJobsStorage": "<Azure-storage-connection-string>",
8+
"AZURE_STORAGE_CONNECTION_STRING": "<Azure-storage-connection-string>"
9+
},
10+
"Host": {
11+
"LocalHttpPort": 7071,
12+
"CORS": "http://127.0.0.1:5500",
13+
"CORSCredentials": true
14+
}
15+
}

0 commit comments

Comments
 (0)