Connecting a BotFramework Bot to Cortana¶
Cortana has recently announced that you can build Cortana skills using Microsoft Bot Framework. With the upgraded experience for building Cortana skills, this capability remains the same – all Bot Framework bots can get the Cortana channel enabled by connecting to the Store. In addition, they receive an enhanced functionality.
Connecting Bot Framework bots to the Store has several advantages. You can still modify their properties. For instance, you can change the skill’s name, descriptions, and invocation names. In addition, you can control how your bot is searched in Cortana by customizing its discoverability properties. You can also deploy them to a designated group of Cortana users, or you can make them available to all Cortana users in the outside would.
You can also compose Bot Framework bots into smart skills. This means that you can create a skill that calls several Bot Framework bots one after the other. For example, a skill can check the weather that is one Bot Framework bot and book a flight that is accomplished by the second Bot Framework bot. These calls can be mixed together with other components registered in Store.
Getting Started with the Azure Bot Service¶
The steps below will guide you through registering a BotFramework bot to the Knowledge Store. If you are an existing user, omit the steps directly below, and refer to the steps Connecting a BotFramework Bot to Cortana.
- Visit the BotFramework site and sign in with your Microsoft Account (MSA) credentials.
Note: To sign into the BotFramework portal, you must have a registered Microsoft account (MSA). If you do not have a MSA and need to create one, click: Create One!
- Click Create a bot or a skill.
- In the My Bots page, click a bot name displayed in the list.
Note: If you have a preexisting bot, you might have to migrate it to Microsoft Azure before you can proceed with the next steps. Click Migrate your bot to Azure for details about migrating your BotFramework bot to Azure.
- Click Web App Bot, and then click Create.
- In the Azure portal, give your BotFramework bot a name, and then click Create.
- Click Channels, and then under Add a featured channel, click Cortana.
- In the Configure Cortana page, scroll down the page to Discovery and Management, and then click Register.
- It is at this point, you will go through the slides of the First Time User Experience tutorial. After you’ve viewed the last slide, click Start and begin creating a new organization.
- Enter an organization name, and then click Next.
- After naming your organization, review the Workspace user interface tips, and then click Got it.
- Enter your First and Last name, and then click Submit.
Note: At this point, you had created an organization in the Workspace. Now you can create a botlet under the organization.
- In the Items Tree, click the Create new icon, and then click New item.
- Click Botlet, and then click Create new.
- Enter a botlet Name, and then select a Category, and the click Next.
- Enter a brief Description, (optional) Upload an image, and then click Done.
- Click Done.
Now that your organization and botlet have been created, you can now create a skill and connect it to Cortana. To create a new skill, visit the BotFramework portal. It is from this portal that you will connect your BotFramework bot to Cortana.
Connecting a BotFramework Bot to Cortana¶
- Visit the BotFramework portal.
- Refer to steps 3 to 7 in the section Getting Started with the Azure Bot Service.
- Register the BotFramework bot in the Workspace by clicking Register.
- On the Connect to Channels page, click Edit.
- Scroll down the page to Discovery and Management, and then click Manage.
- Click the Publish menu tab to view the Publish to self channel details of the newly created skill.
For more details on publishing a skill to a group of designated users or to production (i.e., world), see: Publishing.
As soon as your Bot Framework bot is connected to the Store, you can call it in other botlets. The SCL syntax is shown in the code sample below.
CALL "<organization name>.<botlet name>", "<input string>"
CALL "botframework.mybfbotlet", "Hello!"
You also can write SCL like shown in the sample below to pass user provided input to the bot.
GET_INPUT SET usr_in = USER_INPUT CALL “botframework.mybfbotlet” , usr_in
At this moment, you can only sequentially call Bot Framework bots in botlets. You cannot call individual actions on them and pass and/or retrieve entities.
Deleting the Cortana Channel from a BotFramework skill¶
The steps below describe how to delete the Cortana channel from a BotFramework skill. The entry point for doing these steps starts with the Knowledge Store Workspace and concludes with the deletion process occurring in the BotFramework portal.
- Sign into the Workspace with your Microsoft account.
- In the Items Tree, select the organization that contains your BotFramework skill.
- Select the BotFramework skill, and then click Delete.
- Click Redirect to BotFramework Bot.
- Sign into the BotFramework portal with your Microsoft account.
- Click Delete Channel.
- Click Yes, delete it. This will delete the Cortana channel from the BotFramework bot.
This completes the steps of how to delete the Cortana channel from your BotFramework skill. By completing these steps, the BotFramework skill is now removed from the organization in the Knowledge Store Workspace.
BotFramework Bot OAuth2 Configuration Settings¶
With SCL based botlets built in the Microsoft Knowledge Graph Exchange, we support the same type of authentication that is supported in BotFramework bots. For information on how to create and manage OAuth2 configuration settings for your bot, see: BotFramework Bot OAuth2 Configuration Settings.