Skip to content
Permalink
Browse files

Release 'live' 2-21-2019 (#1320)

  • Loading branch information...
ivorb committed Feb 21, 2019
1 parent 7f418be commit 05ddade244874b7d6e2fc91745131b99cc58b0d6
Showing with 716 additions and 304 deletions.
  1. +98 −31 articles/bot-builder-deploy-az-cli.md
  2. +5 −1 articles/bot-service-channel-connect-email.md
  3. +123 −0 articles/bot-service-channel-connect-line.md
  4. +7 −3 articles/bot-service-manage-overview.md
  5. +0 −2 articles/bot-service-review-guidelines.md
  6. +3 −0 articles/dotnet/bot-builder-dotnet-channeldata.md
  7. +66 −2 articles/includes/snippet-channeldata.md
  8. +1 −0 articles/manage/TOC.md
  9. BIN articles/media/azure-manage-a-bot/app-settings.png
  10. BIN articles/media/channels/LINE-channel-setting-1.png
  11. BIN articles/media/channels/LINE-channel-setting-2.png
  12. BIN articles/media/channels/LINE-channel-type-selection.png
  13. BIN articles/media/channels/LINE-create-channel.png
  14. BIN articles/media/channels/LINE-screenshot-1.png
  15. BIN articles/media/channels/LINE-screenshot-10.png
  16. BIN articles/media/channels/LINE-screenshot-11.png
  17. BIN articles/media/channels/LINE-screenshot-12.jpg
  18. BIN articles/media/channels/LINE-screenshot-2.png
  19. BIN articles/media/channels/LINE-screenshot-4.png
  20. BIN articles/media/channels/LINE-screenshot-5.png
  21. BIN articles/media/channels/LINE-screenshot-6.png
  22. BIN articles/media/channels/LINE-screenshot-7.png
  23. BIN articles/media/channels/LINE-screenshot-8.png
  24. BIN articles/media/channels/LINE-screenshot-9.png
  25. BIN articles/media/channels/LINE-screenshot-conversation.jpg
  26. BIN articles/media/emulator-v4/test-dialog-prompt.png
  27. +4 −4 articles/nodejs/bot-builder-nodejs-proactive-messages.md
  28. +7 −11 articles/nodejs/bot-builder-nodejs-send-suggested-actions.md
  29. +2 −0 articles/v4sdk/bot-builder-channeldata.md
  30. +1 −1 articles/v4sdk/bot-builder-enterprise-template-overview-detail.md
  31. +4 −4 articles/v4sdk/bot-builder-howto-qna.md
  32. +6 −3 articles/v4sdk/bot-builder-howto-v4-luis.md
  33. +127 −69 articles/v4sdk/bot-builder-howto-v4-storage.md
  34. +6 −2 articles/v4sdk/bot-builder-primitive-prompts.md
  35. +173 −116 articles/v4sdk/bot-builder-prompts.md
  36. +83 −55 articles/v4sdk/bot-builder-send-welcome-message.md
@@ -8,10 +8,10 @@ manager: kamrani
ms.topic: get-started-article
ms.service: bot-service
ms.subservice: abs
ms.date: 02/07/2019
ms.date: 02/13/2019
---

# Deploy your bot
# Deploy your bot

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

@@ -20,71 +20,138 @@ After you have created your bot and tested it locally, you can deploy it to Azur
In this article, we'll show you how to deploy C# and JavaScript bots to Azure. It would be useful to read this article before following the steps, so that you fully understand what is involved in deploying a bot.

## Prerequisites
- Install latest version of the [MSBot](https://github.com/Microsoft/botbuilder-tools/tree/master/packages/MSBot) tool.
- A [CSharp](./dotnet/bot-builder-dotnet-sdk-quickstart.md) or [JavaScript](./javascript/bot-builder-javascript-quickstart.md) bot that you have developed on your local machine.

## Create a Web App Bot in Azure
This section is optional if you have already created a bot in Azure that you'd like to use.
- Install latest version of the [msbot](https://github.com/Microsoft/botbuilder-tools/tree/master/packages/MSBot) tool.
- A [CSharp](./dotnet/bot-builder-dotnet-sdk-quickstart.md) or [JavaScript](./javascript/bot-builder-javascript-quickstart.md) bot that you have developed on your local machine.

## 1. Prepare for deployment
The deployment process requires a target Web App Bot in Azure so that your local bot can be deployed into it. The target Web App Bot and the resources that are provisioned with it in Azure are used by your local bot for deployment. This is necessary because your local bot does not have all the required Azure resources provisioned. When you create a target Web App bot, the following resources are provisioned for you:
- Web App Bot – you will use this bot to deploy your local bot into.
- App Service Plan - provides the resources that an App Service app needs to run.
- App Service - service for hosting web applications
- Storage account - contains all your Azure Storage data objects: blobs, files, queues, tables, and disks.

During the creation of the target Web App Bot, an app ID and password are also generated for your bot. In Azure, the app ID and password support [service authentication and authorization](https://docs.microsoft.com/azure/app-service/overview-authentication-authorization). You will retrieve some of this information for use in your local bot code.

> [!IMPORTANT]
> The language for the bot template for the service must match the language your bot is written in.
Creating a new Web App Bot is optional if you have already created a bot in Azure that you'd like to use.

1. Log in to the [Azure portal](https://portal.azure.com).
1. Click **Create new resource** link found on the upper left-hand corner of the Azure portal, then select **AI + Machine Learning > Web App bot**.
1. A new blade will open with information about the Web App Bot.
1. In the **Bot Service** blade, provide the requested information about your bot.
1. Click **Create** to create the service and deploy the bot to the cloud. This process may take several minutes.

## Download the source code
### Download the source code
After creating the target Web App Bot, you need to download the bot code from the Azure portal to your local machine. The reason for downloading code is to get the service references that are in the [.bot file](./v4sdk/bot-file-basics.md). These service reference are for Web App Bot, App Service Plan, App Service, and Storage Account.

1. In the **Bot Management** section, click **Build**.
1. Click on **Download Bot source code** link in the right-pane.
1. Follow the prompts to download the code, and then unzip the folder.

## Decrypt the .bot file
The source code you downloaded from the Azure portal includes an encrypted .bot file. You'll need to decrypt it to copy values into your local .bot file.
### Decrypt the .bot file

The source code you downloaded from the Azure portal includes an encrypted .bot file. You'll need to decrypt it to copy values into your local .bot file. This step is necessary so that you can copy actual service references and not the encrypted ones.

1. In the Azure portal, open the Web App Bot resource for your bot.
1. Open the bot's **Application Settings**.
1. In the **Application Settings** window, scroll down to **Application settings**.
1. Locate the **botFileSecret** and copy its value.

Use `msbot cli` to decrypt the file.
```

```cmd
msbot secret --bot <name-of-bot-file> --secret "<bot-file-secret>" --clear
```

## Update the .bot file
Open the .bot file you decrypted. Copy entries listed under the `services` section, and add them to your local .bot file. For example:

```
{
"type": "endpoint",
"name": "production",
"endpoint": "https://<something>.azurewebsites.net/api/messages",
"appId": "<App Id>",
"appPassword": "<App Password>",
"id": "2
}
### Update your local .bot file

Open the .bot file you decrypted. Copy **all** entries listed under the `services` section, and add them to your local .bot file. Resolve any duplicate service entries or duplicate service IDs. Keep any additional service references your bot depends on. For example:

```json
"services": [
{
"type": "abs",
"tenantId": "<tenant-id>",
"subscriptionId": "<subscription-id>",
"resourceGroup": "<resource-group-name>",
"serviceName": "<bot-service-name>",
"name": "<friendly-service-name>",
"id": "1",
"appId": "<app-id>"
},
{
"type": "blob",
"connectionString": "<connection-string>",
"tenantId": "<tenant-id>",
"subscriptionId": "<subscription-id>",
"resourceGroup": "<resource-group-name>",
"serviceName": "<blob-service-name>",
"id": "2"
},
{
"type": "endpoint",
"appId": "",
"appPassword": "",
"endpoint": "<local-endpoint-url>",
"name": "development",
"id": "3"
},
{
"type": "endpoint",
"appId": "<app-id>",
"appPassword": "<app-password>",
"endpoint": "<hosted-endpoint-url>",
"name": "production",
"id": "4"
},
{
"type": "appInsights",
"instrumentationKey": "<instrumentation-key>",
"applicationId": "<appinsights-app-id>",
"apiKeys": {},
"tenantId": "<tenant-id>",
"subscriptionId": "<subscription-id>",
"resourceGroup": "<resource-group>",
"serviceName": "<appinsights-service-name>",
"id": "5"
}
],
```

Save the file.

## Setup a repository
Create a git repository using your favorite git source control provider. Commit your code into the repository.

## Update App Settings in Azure

### Setup a repository

To support continuous deployment, create a git repository using your favorite git source control provider. Commit your code into the repository.

Make sure that your repository root has the correct files, as described under [prepare your repository](https://docs.microsoft.com/azure/app-service/deploy-continuous-deployment#prepare-your-repository).

### Update App Settings in Azure
The local bot does not use an encrypted .bot file, but the Azure portal has an that you are deploying doesn't
1. In the Azure portal, open the **Web App Bot** resource for your bot.
1. Open the bot's **Application Settings**.
1. In the **Application Settings** window, scroll down to **Application settings**.
1. Locate the **botFileSecret** and delete it.
1. Update the name of the bot file to match the file you checked into the repo.
1. Save changes.

## 2. Deploy using Azure Deployment Center

## Deploy using Azure Deployment Center
Now, you need to connect your git repository with Azure App Services. Follow instructions in the [setup continuous deployment](https://docs.microsoft.com/en-us/azure/app-service/deploy-continuous-deployment) topic. Note that it is recommended to build using `App Service Kudu build server`.
Now, you need to upload your bot code to Azure. Follow instructions in the [Continuous deployment to Azure App Service](https://docs.microsoft.com/azure/app-service/deploy-continuous-deployment) topic.

## Test your deployment
Wait for a few seconds after a succesful deployment and optionally restart your Web App to clear any cache. Go back to your Web App Bot blade and test using the Web Chat provided in the Azure portal.
Note that it is recommended to build using `App Service Kudu build server`.

Once you've configured continuous deployment, changes you commit to your repo are published. However, if you add services to your bot, you will need to add entries for these to your .bot file.

## 3. Test your deployment

Wait for a few seconds after a successful deployment and optionally restart your Web App to clear any cache. Go back to your Web App Bot blade and test using the Web Chat provided in the Azure portal.

## Additional resources

- [How to investigate common issues with continuous deployment](https://github.com/projectkudu/kudu/wiki/Investigating-continuous-deployment)

<!--
@@ -8,7 +8,7 @@ manager: kamrani
ms.topic: article
ms.service: bot-service
ms.subservice: sdk
ms.date: 10/10/2018
ms.date: 02/08/2019
---
# Connect a bot to Office 365 email

@@ -66,6 +66,10 @@ For more information about using `channelData`,
see [how to implement channel-specific functionality](~/v4sdk/bot-builder-channeldata.md).
::: moniker-end

## Other considerations

If your bot does not return a 200 OK HTTP status code within 15 seconds in response to an incoming email message, the email channel will try to resend the message, and your bot may receive the same email message activity a few times. For more information, see the [HTTP details](v4sdk/bot-builder-basics.md#http-details) section in **How bots work** and the how to [troubleshooting timeout errors](https://github.com/daveta/analytics/blob/master/troubleshooting_timeout.md) article.

## Additional resources

<!-- Put whole list in monikers, even though it's just the second item that needs to be different. -->
@@ -0,0 +1,123 @@
---
title: Connect a bot to LINE | Microsoft Docs
description: Learn how to configure a bot's connection to LINE.
keywords: connect a bot, bot channel, LINE bot, credentials, configure, phone
author: ivorb
ms.author: v-ivorb
manager: kamrani
ms.topic: article
ms.service: bot-service
ms.subservice: sdk
ms.date: 1/7/2019
---

# Connect a bot to LINE

You can configure your bot to communicate with people through the LINE app.

## Log into the LINE console

Log into the [LINE developer console](https://developers.line.biz/console/register/messaging-api/provider/) of your LINE account, using *Log in with Line*.

> [!NOTE]
> If you haven't already, [download LINE](https://line.me/), then go to your settings to register your email address.
### Register as a developer

If this is your first time on the LINE developer console, enter your name and email address to create a developer account.

![LINE screenshot register developer](./media/channels/LINE-screenshot-1.png)

## Create a new provider

First, create a provider for your bot if you don't already have one set up. The provider is the entity (individual or company) that offers your app.

![LINE screenshot create provider](./media/channels/LINE-screenshot-2.png)

## Create a Messaging API channel

Next, create a new Messaging API channel.

![LINE screenshot channel type](./media/channels/LINE-channel-type-selection.png)

Create a new Messaging API channel by clicking on the green square.

![LINE screenshot create channel](./media/channels/LINE-create-channel.png)

The name cannot include "LINE" or some similar string. Fill out the required fields and confirm your channel settings.

![LINE screenshot channel settings](./media/channels/LINE-screenshot-4.png)

## Get necessary values from your channel settings

Once you've confirmed your channel settings, you'll be directed to a page similar to this.

![LINE screenshot channel page](./media/channels/LINE-screenshot-5.png)

Click on the channel you created to access your channel settings, and scroll down to find the **Basic information > Channel secret**. Save that somewhere for a moment.

![LINE screenshot channel secret](./media/channels/LINE-screenshot-6.png)

Then, scroll farther to **Messaging settings**. There, you will see a **Channel access token** field, with an *issue* button. Click that button to get your access token, and save that for the moment as well.

![LINE screenshot channel token](./media/channels/LINE-screenshot-8.png)

## Connect your LINE channel to your Azure bot

Log in to the [Azure portal](https://portal.azure.com/) and find your bot, and click on **Channels**.

![LINE screenshot azure settings](./media/channels/LINE-channel-setting-2.png)

There, select the LINE channel and paste the channel secret and access token from above into the appropriate fields. Be sure to save your changes.

Copy the custom webhook URL that Azure gives you.

![LINE screenshot azure settings](./media/channels/LINE-channel-setting-1.png)

## Configure LINE webhook settings

Next, go back to the LINE developer console and paste the webhook URL from Azure into the **Message settings > Webhook URL**, and click **Verify** to verify the connection. If you just created the channel in Azure, it may take a few minutes to take effect.

Then, enable **Message settings > Use webhooks**.

> [!IMPORTANT]
> In LINE Developer Console, you must first set the webhook URL, and only then set **Use webhooks = Enabled**. First enabling webhooks with an empty URL will not set the enabled status, even though the UI may say otherwise.
After you added a webhook URL and then enabled webhooks, make sure to reload this page and verify that these changes were set correctly.

![LINE screenshot webhooks](./media/channels/LINE-screenshot-9.png)

## Test your bot

Once you have completed these steps, your bot will be successfully configured to communicate with users on LINE and is ready to test.

### Add your bot to your LINE mobile app

In the LINE developer console, navigate to the settings page and you will see a QR code of your bot.

In the Mobile LINE app, go to the right most navigation tab with three dots [**...**] and tap on the QR code icon.

![LINE screenshot mobile app](./media/channels/LINE-screenshot-12.jpg)

Point the QR code reader at the QR code in your developer console. You should now be able to interact with your bot in your mobile LINE app and test your bot.

### Automatic messages

When you start testing your bot, you may notice the bot sends unexpected messages that are not the ones you specified in the `conversationUpdate` activity. Your dialog may look something like this:

![LINE screenshot conversation](./media/channels/LINE-screenshot-conversation.jpg)

To avoid sending these messages, you need to switch off the Auto-response messages.

![LINE screenshot auto response](./media/channels/LINE-screenshot-10.png)

Alternatively, you can choose to keep these messages. In this case, it may be a good idea to click “Set message” and edit it.

![LINE screenshot set auto response](./media/channels/LINE-screenshot-11.png)

## Troubleshooting

* In case your bot is not responding to any of your messages at all, navigate to your bot in Azure portal, and choose Test in Web Chat.
* If the bot works there, but does not respond in LINE, reload your LINE Developer Console page and repeat the webhook instructinos above. Be sure you set the **Webhook URL** before enabling webhooks.
* If the bot doesn't work in Web Chat, debug the issue for your bot then come back and finish configuring your LINE channel.

@@ -40,13 +40,17 @@ In the **Overview** blade, you can find high level information about your bot. F

![App Service Settings](~/media/azure-manage-a-bot/app-service-settings.png)

The **Application Settings** blade contains detailed information about your bot, such as the bot's environment, ID, Application Insights key, Microsoft App ID, and Microsoft App password.
The **Application Settings** blade contains detailed information about your bot, such as the bot's environment, debug settings, and application settings keys such as botFilePath and botFileSecret.

### MicrosoftAppID and MicrosoftAppPassword

You can find the **MicrosoftAppID** for your bot in the **Settings** blade. The **MicrosoftAppPassword** for your bot is only shown when you first create your bot.
The **MicrosoftAppID** and **MicrosoftAppPassword** are kept within the bot's `.bot` file. To retrieve them, download the bot file and decrypt it, which may be necessary for you to test locally with the ID and password.

![Microsoft AppID and Password](~/media/azure-manage-a-bot/app-settings.png)
### Bot file path and secret

You can find the **botFilePath** and the **botFileSecret** for your bot in the **Application settings** blade.

![Microsoft bot file path and secret](~/media/azure-manage-a-bot/app-settings.png)

> [!NOTE]
> The **Bot Channels Registration** bot service comes with a *MicrosoftAppID* but because there is no app service associated with this type of service, there is no **Application Settings** blade for you to look up the *MicrosoftAppPassword*. To get the password, you must go generate one. To generate the password for a **Bot Channels Registration**, see [Bot Channels Registration password](bot-service-quickstart-registration.md#bot-channels-registration-password)
@@ -25,8 +25,6 @@ Your app integration and its associated metadata must:

- If your app integration handles users' personal information (personal information includes all information or data that identifies or could be used to identify a person, or that is associated with such information or data. Examples of personal information include: name and address, phone number, biometric identifiers, location, contacts, photos, audio & video recordings, documents, SMS, email, or other text communication, screenshots, and in some cases, combined browsing history), you must provide a prominent link from your app integration to an applicable privacy policy, and such privacy policy must comply with all applicable laws, regulations and policy requirements. This policy should cover what data you are collecting or transmitting, what you will be doing with that data, and (if applicable) who you'll be sharing it with. If you don’t have a privacy statement, here are some third-party resources* that might be of some assistance:

OECD - [Privacy Statement Generator](http://www.oecd.org/internet/ieconomy/oecdprivacystatementgenerator.htm)

Future of Privacy Forum – [Application Privacy Policy Generator](http://www.applicationprivacy.org/do-tools/privacy-policy-generator/)

Iubenda – [Privacy Policy Generator](http://www.iubenda.com/en)
@@ -10,6 +10,9 @@ ms.subservice: sdk
ms.date: 12/13/2017
monikerRange: 'azure-bot-service-3.0'
---

# Implement channel-specific functionality

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

[!INCLUDE [Channel Data Content](../includes/snippet-channeldata.md)]
Oops, something went wrong.

0 comments on commit 05ddade

Please sign in to comment.
You can’t perform that action at this time.