You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/bot-builder-deploy-az-cli.md
+31-10Lines changed: 31 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ ms.author: kamrani
7
7
manager: kamrani
8
8
ms.topic: conceptual
9
9
ms.service: bot-service
10
-
ms.date: 05/23/2019
10
+
ms.date: 08/06/2019
11
11
monikerRange: 'azure-bot-service-4.0'
12
12
---
13
13
@@ -52,6 +52,7 @@ az account set --subscription "<azure-subscription>"
52
52
If you are not sure which subscription to use for deploying the bot, you can view the list of subscriptions for your account by using `az account list` command. Navigate to the bot folder.
53
53
54
54
### Create an App registration
55
+
55
56
Registering the application means that you can use Azure AD to authenticate users and request access to user resources. Your bot requires a Registered app in Azure that provides the bot access to the Bot Framework Service for sending and receiving authenticated messages. To create register an app via the Azure CLI, perform the following command:
56
57
57
58
```cmd
@@ -66,13 +67,19 @@ az ad app create --display-name "displayName" --password "AtLeastSixteenCharacte
66
67
67
68
The above command outputs JSON with the key `appId`, save the value of this key for the ARM deployment, where it will be used for the `appId` parameter. The password provided will be used for the `appSecret` parameter.
68
69
69
-
You can deploy your bot in a new resource group or an exising resource group. Choose the option that works best for you.
70
+
> [!NOTE]
71
+
> If you would like to use an existing App registration, you can use the command:
# [Deploy via ARM template (with **new** Resource Group)](#tab/newrg)
74
+
You can deploy your bot in a new resource group or an existing resource group. Choose the option that works best for you.
72
75
76
+
## Deploy via ARM template (with **new** Resource Group)
77
+
<!--
78
+
## [Deploy via ARM template (with **new** Resource Group)](#tab/nerg)
79
+
-->
73
80
### Create Azure resources
74
81
75
-
You'll create a new resource group in Azure and then use the ARM template to create the resources specified in it. In this case, we are provding App Service Plan, Web App, and Bot Channels Registration.
82
+
You'll create a new resource group in Azure and then use the ARM template to create the resources specified in it. In this case, we are providing App Service Plan, Web App, and Bot Channels Registration.
| location |Location. Values from: `az account list-locations`. You can configure the default location using `az configure --defaults location=<location>`. |
86
93
| parameters | Provide deployment parameter values. `appId` value you got from running the `az ad app create` command. `appSecret` is the password you provided in the previous step. The `botId` parameter should be globally unique and is used as the immutable bot ID. It is also used to configure the display name of the bot, which is mutable. `botSku` is the pricing tier and can be F0 (Free) or S1 (Standard). `newAppServicePlanName` is the name of App Service Plan. `newWebAppName` is the name of the Web App you are creating. `groupName` is the name of the Azure resource group you are creating. `groupLocation` is the location of the Azure resource group. `newAppServicePlanLocation` is the location of the App Service Plan. |
87
94
88
-
# [Deploy via ARM template (with **existing** Resource Group)](#tab/erg)
95
+
## Deploy via ARM template (with **existing** Resource Group)
96
+
<!--
97
+
## [Deploy via ARM template (with **existing** Resource Group)](#tab/erg)
98
+
-->
89
99
90
100
### Create Azure resources
91
101
@@ -95,7 +105,8 @@ When using an existing resource group, you can either use an existing App Servic
95
105
96
106
In this case, we are using existing App Service Plan, but creating new a Web App and Bot Channels Registration.
97
107
98
-
_Note: The botId parameter should be globally unique and is used as the immutable bot ID. Also used to configure the displayName of the bot, which is mutable._
108
+
> [!NOTE]
109
+
> The botId parameter should be globally unique and is used as the immutable bot ID. Also used to configure the displayName of the bot, which is mutable.
99
110
100
111
```cmd
101
112
az group deployment create --name "<name-of-deployment>" --resource-group "<name-of-resource-group>" --template-file "template-with-preexisting-rg.json" --parameters appId="<msa-app-guid>" appSecret="<msa-app-password>" botId="<id-or-name-of-bot>" newWebAppName="<name-of-web-app>" existingAppServicePlan="<name-of-app-service-plan>" appServicePlanLocation="<location>"
@@ -121,23 +132,33 @@ az group deployment create --name "<name-of-deployment>" --resource-group "<name
121
132
122
133
### Retrieve or create necessary IIS/Kudu files
123
134
135
+
### C# bots
136
+
<!--
124
137
### [C# bots](#tab/csharp)
138
+
-->
125
139
126
140
```cmd
127
141
az bot prepare-deploy --lang Csharp --code-dir "." --proj-file-path "MyBot.csproj"
128
142
```
129
143
130
144
You must provide the path to the .csproj file relative to --code-dir. This can be performed via the --proj-file-path argument. The command would resolve --code-dir and --proj-file-path to "./MyBot.csproj"
131
145
132
-
### [JavaScript bots](#tab/javascript)
146
+
147
+
### JavaScript bots
148
+
<!--
149
+
### [Javascript bots](#tab/javascript)
150
+
-->
133
151
134
152
```cmd
135
153
az bot prepare-deploy --code-dir "." --lang Javascript
136
154
```
137
155
138
156
This command will fetch a web.config which is needed for Node.js apps to work with IIS on Azure App Services. Make sure web.config is saved to the root of your bot.
139
157
140
-
### [TypeScript bots](#tab/typescript)
158
+
### TypeScript bots
159
+
<!--
160
+
### [Typescript bots](#tab/typescript)
161
+
-->
141
162
142
163
```cmd
143
164
az bot prepare-deploy --code-dir "." --lang Typescript
6. In the *Bot Channel Registration blade*, click **Test in Web Chat**.
188
209
Alternatively, in the right panel, click the Test box.
189
210
190
-
For more information about channel registration, see [Register a bot with Bot Service](https://docs.microsoft.com/en-us/azure/bot-service/bot-service-quickstart-registration?view=azure-bot-service-3.0).
211
+
For more information about channel registration, see [Register a bot with Bot Service](https://docs.microsoft.com/azure/bot-service/bot-service-quickstart-registration?view=azure-bot-service-3.0).
191
212
192
213
> [!NOTE]
193
214
> A blade is the surface on which service functions or navigation elements appear when selected.
@@ -197,4 +218,4 @@ Deploying your bot to Azure will involve paying for the services you use. The [b
197
218
198
219
## Next steps
199
220
> [!div class="nextstepaction"]
200
-
> [Set up continous deployment](bot-service-build-continuous-deployment.md)
221
+
> [Set up continuous deployment](bot-service-build-continuous-deployment.md)
Copy file name to clipboardExpand all lines: articles/rest-api/bot-framework-rest-connector-api-reference.md
+2-78Lines changed: 2 additions & 78 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,8 @@ ms.author: kamrani
6
6
manager: kamrani
7
7
ms.topic: article
8
8
ms.service: bot-service
9
-
ms.date: 10/25/2018
9
+
ms.date: 08/02/2019
10
+
10
11
---
11
12
12
13
# API reference
@@ -305,83 +306,6 @@ The Microsoft Bot Framework State service is retired as of March 30, 2018. Previ
305
306
|`Get Private Conversation Data`| Retrieves state data that has previously been stored for a specific user within the context of a specific conversation on a channel. |
306
307
|`Delete State For User`| Deletes state data that has previously been stored for a user. |
307
308
308
-
### Set User Data
309
-
Stores state data for the specified user on the specified channel.
310
-
```http
311
-
POST /v3/botstate/{channelId}/users/{userId}
312
-
```
313
-
314
-
|||
315
-
|----|----|
316
-
|**Request body**| A `BotData` object |
317
-
|**Returns**| A `BotData` object |
318
-
319
-
### Set Conversation Data
320
-
Stores state data for the specified conversation on the specified channel.
321
-
```http
322
-
POST /v3/botstate/{channelId}/conversations/{conversationId}
323
-
```
324
-
325
-
|||
326
-
|----|----|
327
-
|**Request body**| A `BotData` object |
328
-
|**Returns**| A `BotData` object |
329
-
330
-
### Set Private Conversation Data
331
-
Stores state data for the specified user within the context of the specified conversation on the specified channel.
332
-
```http
333
-
POST /v3/botstate/{channelId}/conversations/{conversationId}/users/{userId}
334
-
```
335
-
336
-
|||
337
-
|----|----|
338
-
|**Request body**| A `BotData` object |
339
-
|**Returns**| A `BotData` object |
340
-
341
-
### Get User Data
342
-
Retrieves state data that has previously been stored for the specified user across all conversations on the specified channel.
343
-
```http
344
-
GET /v3/botstate/{channelId}/users/{userId}
345
-
```
346
-
347
-
|||
348
-
|----|----|
349
-
|**Request body**| n/a |
350
-
|**Returns**| A `BotData` object |
351
-
352
-
### Get Conversation Data
353
-
Retrieves state data that has previously been stored for the specified conversation on the specified channel.
354
-
```http
355
-
GET /v3/botstate/{channelId}/conversations/{conversationId}
356
-
```
357
-
358
-
|||
359
-
|----|----|
360
-
|**Request body**| n/a |
361
-
|**Returns**| A `BotData` object |
362
-
363
-
### Get Private Conversation Data
364
-
Retrieves state data that has previously been stored for the specified user within the context of the specified conversation on the specified channel.
365
-
```http
366
-
GET /v3/botstate/{channelId}/conversations/{conversationId}/users/{userId}
367
-
```
368
-
369
-
|||
370
-
|----|----|
371
-
|**Request body**| n/a |
372
-
|**Returns**| A [`BotData` object |
373
-
374
-
### Delete State For User
375
-
Deletes state data that has previously been stored for the specified user on the specified channel by using either the [Set User Data](#set-user-data) operation or the [Set Private Conversation Data](#set-private-conversation-data) operation.
376
-
```http
377
-
DELETE /v3/botstate/{channelId}/users/{userId}
378
-
```
379
-
380
-
|||
381
-
|----|----|
382
-
|**Request body**| n/a |
383
-
|**Returns**| An array of strings (IDs) |
384
-
385
309
## Bot Framework Activity schema
386
310
387
311
See the [Bot Framework Activity schema](https://aka.ms/botSpecs-activitySchema) for the objects and properties that your bot can use to communicate with a user.
The bot and user interact and exchange information via activities. Each activity received by your bot application is passed to a bot adapter, which passes activity information to your bot logic and ultimately sends any responses to the user. Receiving an activity, and subsequently processing it through your bot, is called a turn; this represents one complete cycle of your bot. A turn ends when all execution is done, the activity is fully processed and all the layers of the bot have completed.
20
19
21
-
Activities, particularly those that [sent from a bot](#generating-responses) during a bot turn, are handled asynchronously. It's a necessary part of building a bot; if you need to brush up on how that all works, check out [async for .NET](https://docs.microsoft.com/dotnet/csharp/async) or [async for JavaScript](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/async_function) depending on your language choice.
20
+
Activities, particularly those that are [sent from a bot](#generating-responses) during a bot turn, are handled asynchronously. It's a necessary part of building a bot; if you need to brush up on how that all works, check out [async for .NET](https://docs.microsoft.com/dotnet/csharp/async) or [async for JavaScript](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/async_function) depending on your language choice.
For proactive messaging, `serviceUrl` is the URL of the channel that the recipient of the proactive message is using and can be found in `Activity.ServiceUrl`.
120
119
121
-
You'll want to add the above code just prior to the the code that sends the proactive message. This sample has it near the end of `CreateCallback()` in `ProactiveBot.cs`, but it is commented out because it will not work in Emulator without an `appId` and `appPassword`.
120
+
You'll want to add the above code just prior to the the code that sends the proactive message. In the [Proactive Messages Sample](https://github.com/microsoft/BotBuilder-Samples/tree/master/samples/csharp_dotnetcore/16.proactive-messages), you would put it in `NotifyController.cs` just before `await turnContext.SendActivityAsync("proactive hello");`.
For proactive messaging, `serviceUrl` is the URL of the channel that the recipient of the proactive message is using and can be found in `activity.serviceUrl`.
130
129
131
-
You'll want to add the above code just prior to the the code that sends the proactive message. This sample has it near the end of `completeJob()` in `bot.js`, but it is commented out because it will not work in Emulator without an `appId` and `appPassword`.
130
+
You'll want to add the above code just prior to the the code that sends the proactive message. In the [Proactive Messages Sample](https://github.com/microsoft/BotBuilder-Samples/tree/master/samples/javascript_nodejs/16.proactive-messages), you would put it in `index.js` just before `await turnContext.sendActivity('proactive hello');`.
Copy file name to clipboardExpand all lines: articles/v4sdk/bot-builder-howto-v4-storage.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -386,8 +386,8 @@ Comment out Memory Storage, replace with reference to Cosmos DB.
386
386
**bot.js**
387
387
```javascript
388
388
// initialized to access values in .env file.
389
-
var dotenv=require('dotenv');
390
-
dotenv.load();
389
+
constENV_FILE=path.join(__dirname, '.env');
390
+
require('dotenv').config({ path:ENV_FILE });
391
391
392
392
// Create local Memory Storage - commented out.
393
393
// var storage = new MemoryStorage();
@@ -519,8 +519,8 @@ If you did not add code to load your `.env` file to implement Cosmos DB storage,
519
519
520
520
```javascript
521
521
// initialized to access values in .env file.
522
-
var dotenv=require('dotenv');
523
-
dotenv.load();
522
+
constENV_FILE=path.join(__dirname, '.env');
523
+
require('dotenv').config({ path:ENV_FILE });
524
524
```
525
525
Now update your code to point "_storage_" to your existing Blob Storage account, by commenting out previous storage definitions and adding the following.
0 commit comments