Have you been coding your chat bot using the Microsoft Bot Framework? Good news! One of the long awaited features is finally here: the Skype for Business channel! Using this channel, you can now get your but to communicate with users using Skype for Business. This is especially good news for enterprises where S4B is often the primary communication tool. Bots were already available through Microsoft Teams, but not all companies are ready for that yet. Skype was in there as well, but is mostly used on the consumer side. So great to have Skype for Business joining the club!
How to enable the Skype for Business channel
Enabling a bot for a new channel is usually pretty simple. The Skype for Business channel though requires a bit more work.
Note: in order to perform this step you need to be an admin of your Skype for Business instance.
Here’s what you need to do:
- Go to https://www.botframework.com, log in and click on the bot you want enabled.
- Add the Skype for Business channel to your bot.
- When the channel has been added, the page will display:
Your bot is enabled for the Skype for Business Channel.
Want to add your bot to Skype for Business tenant?
underneath is a link that says Learn how. The link could’ve better been a button if you ask me, there’s not much emphasis now even though the instructions on that page are critical to get it working.
- The page will list some commands you need to run in a Powershell window. First, Download and install the Skype for Business Online Connector module and then run:
PowerShell1Import-PSSession (New-CsOnlineSession -Credential (Get-Credential))
- This will enter you into a session connected to the remote Skype for Business cmdlets. Now you need to register your bot:
PowerShell1New-CsOnlineApplicationEndpoint -ApplicationId 110e87ba-9f5e-407e-a199-037e0f05bb35 -Name NameOfTheBot -Uri sip:email@example.com
There’s a little catch here. The example says firstname.lastname@example.org. Actually this should’ve said: email@example.com. Adding a user using a custom domain as the sample shows does not work, at least not at this time. You’ll get a pretty non-descriptive error saying “Cmdlet invocation error” and “Could not find the application endpoint” if you try to do it this way. So make sure you pick a user from your tenant and that you use the tenant.onmicrosoft.com domain to identify it.
Now your bot will, after a wait (which can take up to 8 hours), appear in Skype for Business and users can interact with it. There are numerous possibilities for this. For instance, our bot helps us with tasks like requesting leave, booking hours and remind me to book my hours when I once again forgot to 😉
Update: after waiting for a while, you might be able to find your bot in the Skype directory, but interacting with it doesn’t work. This problem is being looked into, as soon as I know a way to resolve it I’ll update this blog post accordingly.
Update 05/29: after waiting some more I decided to delete the endpoint and retry creating it. And sure enough, my bot is now responding! Problem solved, it seems.