Microsoft’s Bot Framework allows developers to easily create and deploy bots to many different channels, one of which being a Cortana channel. Once your bot has been developed and is ready to publish, you can make this available for use by Cortana as a ‘Cortana Skill’. You can find more information about Cortana Skills themselves from the Microsoft documentation at https://docs.microsoft.com/en-us/cortana/skills/overview. This blog will give a quick example of how to connect a bot to the Cortana channel.
The first thing to check before creating your bot would be if your account is an organizational type or not. Unfortunately, at the time of writing this blog, if your account is an organizational account you won’t be able to connect your bots to Cortana, so you’ll need to use a different account. Fortunately, you’re able to sign up for a trial Azure account at https://azure.microsoft.com/en-us/. For this trial account you’ll need to verify by phone and by card (you’ll need a debit or credit card for verification, but it won’t get charged as this is a free account).
Once your account has been sorted out and you’ve developed your bot in Azure, you can navigate to the ‘Channels’ area in your Bot Web App Service and select to add a Cortana channel. To add the Cortana Channel, you’ll need to fill in required information which involves the Display text, Invocation Name, Description and Primary Category. You also have the option to add more details like an icon, a subcategory, a second category, tags, data for Cortana’s notebook to provide the bot and the ability to manage a User’s identity. Once you save this channel that will automatically publish it for your own use with Cortana.
On the channel settings there’s also a manage button which takes you to the Cortana Skills site (https://www.knowledge.store). If it’s your first time here, you’ll be given a walkthrough and prompted to create your first organization/botlet. You can skip this and go straight to your workspace which at this point should contain your bot framework bot. From the workspace area you can manage your existing Cortana Skills and even create new ones. By selecting the existing bot we created in Azure and navigating to the Publish tab, we can check the details of the skill and even have the option to publish it to a group or the world.
Now that it’s published we’ll need to check a few things before logging into this account with Cortana. Unfortunately, at the time of writing this blog, if you’re outside of the US you’ll run into problems with Cortana connecting to your bot unless you change two settings. First, you’ll need to change Cortana’s Language to be set to English (United States). You can search for ‘Change Cortana Language’ using the windows search and change it from there. Next, you’ll need to change your Windows Settings Region to ‘United States’, which again you can search for and change.
Now if I bring up Cortana and use the Invocation Name I set for my bot (which in this case is just ‘Test’) Cortana will attempt to connect to my Bot. The screenshots below somewhat show what the dialog would be like when talking to my bot which is used to contact someone else using either a Facebook message, SMS or an Email. Cortana follows the same dialog that the bot provides to every other channel and displays things like buttons.