Microsoft Bot Framework

Type: NLP Worker

A Microsoft Bot Framework worker takes input and sends it to a Microsoft Bot Framework bot for inference.

Creating a Microsoft Bot Framework bot

The following contains useful documentation on getting started with a new Ms Bot Framework Worker that will be needed in the following sections: https://docs.microsoft.com/en-us/azure/bot-service/bot-service-quickstart-create-bot?view=azure-bot-service-4.0&tabs=javascript%2Cvs

Assuming you have setup an Ms Bot Framework Bot, you can find the required information for creating a worker within the Azure portal by following these steps:

  1. Message Endpoint

    • From Home, navigate to Resource Groups.
    • Select the resource group you have deployed your Bot Framework to.
    • Select your Bot Framework, it should be of type Bot Channels Registration
    • In the overview of your bot framework you should see a Messaging Endpoint, save this. Message Endpoint
  2. Client Id and Secret

    • From Home, navigate to Resource Groups.
    • Select the resource group you have deployed your Bot Framework to.
    • Select your Bot Framework, it should be of type Bot Channels Registration
    • In Configuration there should be a Microsoft App ID, save this. Client Id and Secret

If you do not have your client secret saved somewhere you will need to generate a new one. Click the Manage link above your ClientId, there will be an option to generate a new Client Secret. Use this and save your new Client Secret somewhere secure.

Creating a Microsoft Bot Framework worker

Once you have all of the required information from the previous step you can create your worker. First you will need to create a secret which contains your ClientId and ClientSecret.

{
    "Name": "msBotFramework",
    "Type": "secretdoc",
    "Value": {
        "ClientId": "your-client-id",
        "ClientSecret": "your-client-secret"
    }
}
sb-cli secret create path/to/file.json

If you are doing this through Portal, use the Custom Json type.

Once you have created the secret you can create a new worker with the config:

{
  "Data": {
    "MessagingEndpoint": "https://your-messaging-endpoint.azurewebsites.net/api/messages",
    "MsBotFrameworkSecret": "srn:vault::org:secretdoc:secretName"
  },
  "Organization": "engdmacklin",
  "Config": {},
  "Enabled": true,
  "Description": "Worker to talk to MS Bot Framework",
  "Type": "ms-bot-framework-worker",
  "Name": "myMsWorker"
}
sb-cli worker create path/to/file.json