Join Sahil Malik for an in-depth discussion in this video Side loading and testing your bot, part of Microsoft Teams Bot Development.
- [Lecturer] Now with my bot packaged up, this zip file here, which is these three files inside, all we need to do is side load this and test it out. So, at this point, you should have side loading of bots enabled in your Office 365 tenancy, I showed you how to do that in the previous chapter. I already have that set up in my environment. Let me go ahead and side load this bot. So let's go into Microsoft Teams, and if you don't have any teams created, click on create team, and I'll just call this new team as SomeTeam.
Click next, and this should go ahead and create a team for you. Now this team currently has got one channel in it, that is enough for us to get started. Let me go ahead and side load this bot. Click here and click on manage team, click on bots, and look for the link down here that says side load a bot or a tab. And here, browse to your mybot.zip file and choose to upload that in here.
If the general schema structure is correct, you should see something like this. Let me maximize this. It is worth pointing out that due to a very recent change in the user interface, the process of side loading the bot has changed very slightly. What you do is that you access this screen by using manage team and then you go to the apps tab and here, you would choose to upload a custom app.
And then you would simply upload the same bot file that I showed you earlier. And then you would click on the bot and choose to enable it, and this should make the bot available in your team. So see that the name of your bot appears if you click on it, it tells you the details about your bot. Let's try it out. First, let me try it out in a one-on-one chat.
So in a one-on-one chat, it's going to work just like before. Now, what's important to note is that I continue to reference this bar as myCustomTeamsBot even though it is referencing the myCustomTeamsBot3978. myCustomTeamsBot, where is it getting that name from, minus the 3978. The answer is, that is actually your app registration, so even during testing, the display name of the bot and the description of the bot, you see or the user see, will be what's in the registration.
Of course the bot handle is still 3978. Let's try it out. Let's go back to Microsoft Teams and this time around when I click here, now because the bot was side loaded and in the manifest.json, I had specified that in personal scope there's one command that reads support aboutme. See, we are already getting a better user experience. So I can just click on there, it prompts me with that command and let me also make sure that my bot is actually running, it wasn't, ngrok is running, so I'm just going to say, npm start, you know before I run the bot, I should make sure that the bot is running.
Let's put this on the right hand side so we can see both of these running in parallel. So the bot has started, ngrok is listening, everything matches, click enter. And now you see that it writes out the aboutme information. So the one-on-one chat can be tested like this, but now, let's test it in a team's chat environment. Let's go to my team, let's go to SomeTeam in the general channel that I had here.
And here, I'll say @myCustomTeamsBot, so if I just click on add a bot, it won't actually show me myCustomTeamsBot because it'll only show me the publicly available bot, so you'll have to actually type a little bit here. So myCustomTeamsBot, and again it prompts me with whatever it supports in this scope, which is the team's scope. So the getchannels command is supported here, so I click here, hit enter, and now you see that it tells me that it supports one channel inside this team.
If you add a channel, try it again and it should then show two, three, so on so forth. So this is how you go about side loading the bot and testing it. When you're done testing it, you simply go here, go to manage team, and then simply choose to delete this bot. And, oh yes, once you're done registering your bot and testing your bot and all of that, that same zip file can be submitted to the Office 365 app store, so your bot is now available to a wider audience.
- What are bots?
- Creating bots
- Testing using ngrok
- Deploying bots to Microsoft Teams
- Testing bots
- Bots as Azure AD applications
- Updating bot registration in Azure
- Building the bot package