[O365] Adding your chatbot to Skype for Business

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. 
    skype4b
  • 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:

     
  • This will enter you into a session connected to the remote Skype for Business cmdlets. Now you need to register your bot:

     

There’s a little catch here. The example says username@yourdomain.com. Actually this should’ve said: username@tenant.onmicrosoft.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.

 

Jennifer

4 thoughts on “[O365] Adding your chatbot to Skype for Business

  1. Hi Jasper. After the May SfB CU, you can use the username@yourdomain.com
    But I’m still not able to see it in the SfB client. I also had to run a command to create the user my on-premises domain.
    Do you know if I missing anything else?

    1. Hi Hubo,

      Unfortunately I have no solution yet. I’m using using the on-prem version but an Office365 instance, it’s not working there either. When I find out what is wrong, I’ll update this post accordingly.

  2. Hello, I’m sorry to bother you, but since I’m trying to create a BOT to be used with SFB, I’d like to know something: Is there posible to know the name (user name, or display name) from the person the BOT is chatting with?
    The BOT will perform some tasks on behalf of the user, and I don’t know to add an extra step to the BOT asking to the user “who are you?”, or performing some extra authentication methods.
    Thank you in advance

    1. Doesn’t bother at all 🙂 You can get the name from your user from the channel data, but the question is: how reliable / safe is that? For authentication you’re currently bound to doing an OAuth authentication between your user and the service you want to use. Check the OAuth sample for that: https://blogs.msdn.microsoft.com/tsmatsuz/2016/09/06/microsoft-bot-framework-bot-with-authentication-and-signin-login/

      There’s a lot of folks asking about this and it would make much more sense that your bot can get at least some authentication info when you’re already signed in to Office365. I am guessing there might be something of a consent screen in the future that gives the user control over what your bot can and cannot access.

Leave a Reply

Your email address will not be published. Required fields are marked *