Skip to content

Commit 83aedd6

Browse files
JonathanFingoldivorb
authored andcommitted
Updates to deploying samples article (#1215)
* Updates to deploying samples article * Update per feedback * Fix copy-paste error, some formatting.
1 parent 83ded63 commit 83aedd6

File tree

3 files changed

+63
-39
lines changed

3 files changed

+63
-39
lines changed

articles/bot-builder-deploy-az-cli.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ az bot create --kind webapp --name <bot-resource-name> --location <geographic-lo
7878

7979
| Option | Description |
8080
|:---|:---|
81-
| --name | A unique name that is used to deploy the bot in Azure. It could be the same name as your local bot. DO NOT include spaces in the name. |
81+
| --name | A unique name that is used to deploy the bot in Azure. It could be the same name as your local bot. DO NOT include spaces or underscores in the name. |
8282
| --location | Geographic location used to create the bot service resources. For example, `eastus`, `westus`, `westus2`, and so on. |
8383
| --lang | The language to use to create the bot: `Csharp`, or `Node`; default is `Csharp`. |
8484
| --resource-group | Name of resource group in which to create the bot. You can configure the default group using `az configure --defaults group=<name>`. |
@@ -93,7 +93,7 @@ az bot create --kind webapp --name <bot-resource-name> --location <geographic-lo
9393

9494
| Option | Description |
9595
|:---|:---|
96-
| --name | A unique name that is used to deploy the bot in Azure. It could be the same name as your local bot. DO NOT include spaces in the name. |
96+
| --name | A unique name that is used to deploy the bot in Azure. It could be the same name as your local bot. DO NOT include spaces or underscores in the name. |
9797
| --location | Geographic location used to create the bot service resources. For example, `eastus`, `westus`, `westus2`, and so on. |
9898
| --lang | The language to use to create the bot: `Csharp`, or `Node`; default is `Csharp`. |
9999
| --resource-group | Name of resource group in which to create the bot. You can configure the default group using `az configure --defaults group=<name>`. |

articles/bot-builder-deploy-samples.md

Lines changed: 58 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -8,37 +8,47 @@ manager: kamrani
88
ms.topic: get-started-article
99
ms.service: bot-service
1010
ms.subservice: abs
11-
ms.date: 12/11/2018
11+
ms.date: 12/17/2018
1212
---
1313

1414
# Deploy bots from botbuilder-samples repo
1515

1616
[!INCLUDE [pre-release-label](./includes/pre-release-label.md)]
1717

1818
In this article, we'll show you how to deploy C# and JavaScript samples that are in the [botbuilder-samples](https://github.com/Microsoft/BotBuilder-Samples)
19-
repo to Azure.
19+
repo to Azure.
2020

21-
Instructions to deploy sample bots is _different_ from the instructions to [deply a bot that you might create with all the resource
22-
provisioned in Azure](https://docs.microsoft.com/en-us/azure/bot-service/bot-builder-deploy-az-cli?view=azure-bot-service-4.0&tabs=csharp).
21+
Instructions to deploy sample bots is _different_ from the instructions to [deploy a bot that you might create with all the resources already provisioned in Azure](https://docs.microsoft.com/en-us/azure/bot-service/bot-builder-deploy-az-cli?view=azure-bot-service-4.0&tabs=csharp).
2322

24-
Note that deploying bots from the [botbuilder-samples](https://github.com/Microsoft/BotBuilder-Samples) repo to Azure will involve paying for
25-
the services you use. The [billing and cost management](https://docs.microsoft.com/en-us/azure/billing/) article helps you
26-
understand Azure billing, monitor usage and costs, and manage your account and subscriptions.
23+
> [!IMPORTANT]
24+
> Deploying a bot from the [botbuilder-samples](https://github.com/Microsoft/BotBuilder-Samples) repo to Azure will provision Azure services and will involve paying for the services you use.
25+
> The [billing and cost management](https://docs.microsoft.com/en-us/azure/billing/) article helps you understand Azure billing, monitor usage and costs, and manage your account and subscriptions.
2726
28-
It would be useful to read this article before following the steps, so that you fully understand what is involved in deploying a bot.
27+
It would be useful to read this article once through before following the steps, so that you fully understand what is involved in deploying a bot.
2928

3029
## Prerequisites
30+
3131
- If you don't have an Azure subscription, create a [free account](https://azure.microsoft.com/free/) before you begin.
32-
- Install [.NET Core SDK](https://dotnet.microsoft.com/download) >=v2.2.
33-
- Install the latest version of the [Azure cli tool](https://docs.microsoft.com/en-us/cli/azure/install-azure-cli?view=azure-cli-latest).
34-
- Install the latest `botservice` extension for the `az` tool.
32+
- Install [.NET Core SDK](https://dotnet.microsoft.com/download) >= v2.2. Use `dotnet --version` to see what version you have.
33+
- Install the latest version of the [Azure cli tool](https://docs.microsoft.com/en-us/cli/azure/install-azure-cli?view=azure-cli-latest). Use `az --version` to see what version you have.
34+
- Install the latest `botservice` extension for the `az` tool.
3535
- First, remove the old version using `az extension remove -n botservice` command. Next, use the `az extension add -n botservice` command to install the latest version.
3636
- Install latest version of the [MSBot](https://github.com/Microsoft/botbuilder-tools/tree/master/packages/MSBot) tool.
3737
- You'll need [LUIS CLI](https://github.com/Microsoft/botbuilder-tools/tree/master/packages/LUIS#installation) if the the clone operation includes LUIS or Dispatch resources.
3838
- You'll need [QnA Maker CLI](https://github.com/Microsoft/botbuilder-tools/tree/master/packages/QnAMaker#as-a-cli) if the clone operation includes QnA Maker resources.
3939
- Install [Bot Framework Emulator](https://aka.ms/Emulator-wiki-getting-started).
4040
- Install and configure [ngrok](https://github.com/Microsoft/BotFramework-Emulator/wiki/Tunneling-%28ngrok%29).
41-
- Knowledge of [.bot](v4sdk/bot-file-basics.md) file.
41+
- Knowledge of [.bot](v4sdk/bot-file-basics.md) files.
42+
43+
### C\#
44+
45+
`msbot clone services` does not upload your code files to Azure, just the DLL and a few other files. You need to compile the sample before running this command.
46+
47+
### Service names
48+
49+
In addition to deploying your bot, the `msbot clone services` command provisions all associated services to your chosen subscription.
50+
51+
If any those name-service combinations already exist in the subscription, the command will generate an error, and you will need to delete your partial deployment before starting again. This includes LUIS applications, QnA Maker knowledge bases, and Dispatch models.
4252

4353
## Deploy JavaScript and C# bots using az cli
4454

@@ -47,82 +57,94 @@ Open a command prompt to log in to the Azure portal.
4757
```cmd
4858
az login
4959
```
50-
A browser window will open, allowing you to sign in.
5160

52-
### Set the subscription
61+
A browser window will open, allowing you to sign in.
62+
63+
### Set the subscription
64+
5365
Set the subscription by using the following command:
5466

5567
```cmd
5668
az account set --subscription "<azure-subscription>"
57-
```
69+
```
5870

5971
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.
6072

61-
Navigate to the bot folder.
62-
```cmd
73+
Navigate to the bot folder.
74+
75+
```cmd
6376
cd <local-bot-folder>
6477
```
6578

66-
### Azure subscription account
67-
Before proceeding, read the instructions that apply to you based on the type of email account you use to log in to Azure.
79+
### Clone the sample
6880

69-
**MSA email account**
81+
**Azure subscription account**: Before proceeding, read the instructions that apply to you based on the type of email account you use to log in to Azure.
7082

71-
If you are using a [MSA](https://en.wikipedia.org/wiki/Microsoft_account) email account, you will need to create the appId and appSecret to use with `msbot clone services` command.
83+
**Creating services**: The `msbot clone services` command will create Azure services for the bot.
7284

73-
- Go to the [Application Registration Portal](https://apps.dev.microsoft.com/). Click on **Add an app** to register your application, create **Application Id**, and **Generate New Password**.
74-
- Save both application id and the new password you just generated, so you that can use them with `msbot clone services` command.
85+
1. It lists the services it will create and prompts you to confirm the operation before continuing. If you decline, the command exits without creating any of the services.
86+
1. It has you authenticate with Azure before proceeding.
87+
88+
**LUIS services**: If your bot uses LUIS or Dispatch, you will need to include your LUIS authoring key in the `msbot clone services` command.
89+
90+
#### MSA email account
91+
92+
If you are using a [MSA](https://en.wikipedia.org/wiki/Microsoft_account) email account, you will need to create the appId and appSecret to use with `msbot clone services` command.
93+
94+
- Go to the [Application Registration Portal](https://apps.dev.microsoft.com/). Click on **Add an app** to register your application, create **Application Id**, and **Generate New Password**.
95+
- Save both application id and the new password you just generated, so you that can use them with `msbot clone services` command.
7596
- To deploy, use the command that applies to your bot.
7697

7798
# [C#](#tab/csharp)
7899

79-
`msbot clone services --folder deploymentScripts/msbotClone --location "<geographic-location>" --proj-file "<your.csproj>" --name "<bot-name>" --appid "xxxxxxxx" --password "xxxxxxx" --verbose`
100+
`msbot clone services --folder deploymentScripts/msbotClone --location "<geographic-location>" --proj-file "<your.csproj>" --name "<bot-name>" --appId "xxxxxxxx" --appSecret "xxxxxxx" --verbose --luisAuthoringKey <luis-authoring-key>`
80101

81102
[!INCLUDE [deployment note](./includes/deployment-note-cli.md)]
82103

83104
# [JavaScript](#tab/js)
84105

85-
`msbot clone services --folder deploymentScripts/msbotClone --location "<geographic-location>" --code-dir . --name "<bot-name>" --appid "xxxxxxxx" --password "xxxxxxx" --verbose`
86-
106+
`msbot clone services --folder deploymentScripts/msbotClone --location "<geographic-location>" --code-dir . --name "<bot-name>" --appId "xxxxxxxx" --appSecret "xxxxxxx" --verbose --luisAuthoringKey <luis-authoring-key>`
87107

88108
[!INCLUDE [deployment note](./includes/deployment-note-cli.md)]
89109

90110
---
91111

92-
**Business or school account**
112+
#### Business or school account
93113

94114
If your are using an email account provided to you by your business or school to log in to Azure, you don't need to create the application id and password. To deploy, use the command that applies to your bot.
95115

96116
# [C#](#tab/csharp)
97117

98-
`msbot clone services --folder deploymentScripts/msbotClone --location "<geographic-location>" --verbose --proj-file "<your-project-file>" --name "<bot-name>"`
118+
`msbot clone services --folder deploymentScripts/msbotClone --location "<geographic-location>" --verbose --proj-file "<your-project-file>" --name "<bot-name>" --luisAuthoringKey <luis-authoring-key>`
99119

100120
[!INCLUDE [deployment note](./includes/deployment-note-cli.md)]
101121

102122
# [JavaScript](#tab/js)
103123

104-
`msbot clone services --folder deploymentScripts/msbotClone --location "<geographic-location>" --verbose --code-dir . --name "<bot-name>"`
105-
124+
`msbot clone services --folder deploymentScripts/msbotClone --location "<geographic-location>" --verbose --code-dir . --name "<bot-name>" --luisAuthoringKey <luis-authoring-key>`
106125

107126
[!INCLUDE [deployment note](./includes/deployment-note-cli.md)]
108127

109128
---
110129

111130
#### Save the secret used to decrypt .bot file
112-
It is important to note that the deployment process creates a _new .bot file and encrypts it using a secret_. While the bot is being deployed, you'll see the following message in the command-line asking you to save the .bot file secret.
131+
132+
It is important to note that the deployment process creates a _new .bot file and encrypts it using a secret_. While the bot is being deployed, you'll see the following message in the command-line asking you to save the .bot file secret.
113133

114134
`The secret used to decrypt myAzBot.bot is:`
115135
`hT6U1SIPQeXlebNgmhHYxcdseXWBZlmIc815PpK0WWA=`
116136

117137
`NOTE: This secret is not recoverable and you should save it in a safe place according to best security practices.
118-
Copy this secret and use it to open the <file.bot> the first time.`
119-
138+
Copy this secret and use it to open the <file.bot> the first time.`
139+
120140
Save the .bot file secret for later use. The new encrypted .bot file is used in the Azure portal with the botFileSecret. If you need to change the bot file name or secret later on, go to **App Service Settings -> Application Settings** section in the portal. Note that in the appsettings.json or .env file, the bot file name is updated with the latest bot file that was created.
121141

122142
### Test your bot
123-
In the emulator, use production endpoint to test your app. If you want to test it locally, make sure your bot is running on your local machine.
143+
144+
In the emulator, use production endpoint to test your app. If you want to test it locally, make sure your bot is running on your local machine.
124145

125146
### To update your bot code in Azure
147+
126148
DO NOT use `msbot clone services` command to update the bot code in Azure. You must use the `az bot publish` command as shown below:
127149

128150
```cmd
@@ -138,7 +160,7 @@ az bot publish --name "<your-azure-bot-name>" --proj-file "<your-proj-file>" --r
138160

139161
## Additional resources
140162

141-
When you deploy a bot, typically these reources are created in the Azure portal:
163+
When you deploy a bot, typically these resources are created in the Azure portal:
142164

143165
| Resources | Description |
144166
|----------------|-------------|
@@ -153,5 +175,6 @@ To see documentation on `az bot` commands, see the [reference](https://docs.micr
153175
If you are unfamiliar with Azure resource group, see this [terminology](https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-group-overview#terminology) topic.
154176

155177
## Next steps
178+
156179
> [!div class="nextstepaction"]
157180
> [Set up continous deployment](bot-service-build-continuous-deployment.md)

articles/includes/deployment-note-cli.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@ It is highly recommended that you use the `verbose` option to help troubleshoot
44

55
| Arguments | Description |
66
|--------------|-------------|
7-
| `folder` | Location of the `bot.receipe` file. By default the receipe file is created in the `DeploymentsScript/MSBotClone`. DO NOT MODIFY this file.|
7+
| `folder` | Location of the `bot.recipe` file. By default the recipe file is created in the `DeploymentsScript/MSBotClone`. DO NOT MODIFY this file.|
88
| `location` | Geographic location used to create the bot service resources. For example, eastus, westus, westus2 etc.|
99
| `proj-file` | For C# bot it is the .csproj file. For JS bot it is the startup project file name (e.g. index.js) of your local bot.|
10-
| `name` | A unique name that is used to deploy the bot in Azure. It could be the same name as your local bot. DO NOT include spaces in the name.|
10+
| `name` | A unique name that is used to deploy the bot in Azure. It could be the same name as your local bot. DO NOT include spaces or underscores in the name.|
11+
| `luisAuthoringKey` | Your authoring key for the appropriate LUIS authoring region for the LUIS resources. |
1112

1213
Before Azure resources can be created, you'll be prompted to complete authentication. Follow the instructions that appear on the screen to complete this step.
1314

0 commit comments

Comments
 (0)