The first option (based on Dorado) is still in its alpha version, you’ll need to send your Microsoft account (MSA) to
firstname.lastname@example.org to get approved. It provides a unified platform for building and managing Cortana skills, but less control on implementation details.
The second option (based on Bot Framework) is publically available, together with its introduction video. However in practice there could be many pitfalls for someone starting from scratch. This walkthrough will guide you step by step to create a simple Cortana skill.
As discribed in the official document, the major steps are as follows.
- Build or reuse an existing bot using the latest BotBuilder SDK.
- Use LUIS.ai in your bot if you need natural language understanding capabilities in your bot.
- Use the new speech functionalities in the BotBuilder SDK to give your bot a voice.
- Deploy your bot to Azure.
- Register your bot with the Bot Framework.
- Add your bot to the Cortana Channel.
- Publish your Cortana skill.
We’ll walk through each step in details.
0. Set up your Cortana skills development environment.
The first thing to do is make sure you have access to all the resources listed in this article. Note that the Microsoft account (MSA) required for Cortana and LUIS registration can not be the
email@example.com account for Microsoft employees.
1. Build or reuse an existing bot using the latest BotBuilder SDK.
2. Use LUIS.ai in your bot if you need natural language understanding capabilities in your bot.
LUIS.ai is a language understanding framework that can work with Bot Framework. Following this toturial you will be able to create a LUIS applicaiton. It’s not necessary to add an intent or entitie to make your LUIS model work, if Luis cannot recognize an intent, it will return an empty string for your bot to handle, see this question.
After you’ve successfully created an application, you can see the application ID and keys. Adding these information to the bot you’ve created in step 1 like this, your bot will be able to exploit LUIS features. Here is a more sophisticated LUIS exmaple.
3. Use the new speech functionalities in the BotBuilder SDK to give your bot a voice.
See this tutorial. Also in align with the above mentioned LUIS example, we can also use
context.SayAsync(text, speech) instead of
context.PostAsync(text) to add speech to your bot.
4. & 5. Deploy your bot to Azure. Register your bot with the Bot Framework.
If you’re using the Bot Builder SDK for Node.js, set the following environment variables:
If you’re using the Bot Builder SDK for .NET, set the following key values in the web.config file:
6. & 7. Add your bot to the Cortana Channel. Publish your Cortana skill.
Now you’ll be able to try out the Cortana skill you’ve just built, make sure the Cortana on your system is logged in with the same account you used for development.