From the course: Microsoft Teams Bot Development

Registering your bot

- [Instructor] Now with the core changes for my bot done, I still have to specify this appId and appPassword. And this appId and appPassword, I will get this by registering my bot inside of Microsoft Teams or is it Azure? Well I seem to be a little confused whether it's Azure or whether it's Microsoft Teams. So let's clarify that. So, I'm going to open my browser and I'm going to visit dev.botframework.com/bots/new. And in another tab, I will also visit dev.botframework.com and hit Enter and you'll see that it gives me a button here to create a bot or skill. Let's click on that button. Here, you see the URL up here and the URL I went to are different. Well, what happens is, that if you click on this button here at/bots, the button that they're exposing through the website currently, that button will take you to registering the bot in Azure. And this is the direction that Microsoft is sort of pushing us in because they want you to register the bot in Azure for some good reasons. They're not just trying to push Azure down our throats. In fact, in Azure you can register a bot and not host it in Azure. So there are these options. Just is easier to do it in Azure, of course. I'll show you both options. But I will say that, currently, the older way is a little bit more reliable. And this is what I'm going to use for all the demos. But I will demonstrate both ways of registering your bot. And, I think in about three months from now, Azure will be the only choice, so it's good to know both options. So I'll show you both options. But, I'm going to start with the older option first. So let's go ahead and sign in. And go ahead and sign in using your Office 365 credentials. And it shows you a little form where you just specify some details and your bot will be set up. So, you see that there is an icon for the bot here? I don't need to really change this icon though, when I do register the bot or submit it to the app store or even sideload it, then I definitely need to provide the icon. The way users differentiate a bot from a user is that the same icon will appear in a hexagon. So, users appear in a square and bots appear in a hexagon. And that's how a bot looks different. Of course, it's nice if we call our bot something bot as well. So, I'm going to call this myCustomTeamsBot. And give it a bot handle. Now this handle needs to be unique. So, there's a chance somebody's already taken it. If they have, we'll just pick a different name. So, is a github bot. Let's scroll down here. Now, this messaging endpoint is where your bot is listening for messages. And that would be my ngrok URL in dev time. And probably some https website of the Internet after my bot is done. I haven't really exposed my endpoint yet. So I'm just going to write https://something here. But I have the flexibility of coming back in here and changing it. The next thing I need to do is provide an App Id and password. So, click on this button and go ahead and sign in as the same user ID you were signed in as earlier. And, at this point, Microsoft goes ahead and creates an app ID and password for me. Now please note this down. So I'm going to go back to VS Code, open a new tab, and my botName was myCustomTeamsBot and the appId was this. I'm going to save this on the desktop. Now, I must say that I will not provide this in the source code because your ID will be different than mine because you're working in your tenancy, I'm working in mine. So, don't use this GUID, use the one that you get in registering in your dev tenancy. Okay. Let's come back here. And I'm going to say Generate an app password to continue. So click on that button and go ahead and copy/paste this. And save it. Again, this ID will be different between me and you. And this ID is supposed to be kept secret. Now if you try using mine, by the time I ship this course, I would have already deleted it. It's not going to work. So, make sure that you use your app password, not mine. Okay, I'm going to save this and don't lose that information. You can't see it again. Let's come back here. Click Ok. And I'm going to say Finish and go back to the Bot Framework. And it already put this GUID in here for me. You can optionally enable analytics using Azure Application Insights. I'll skip that part. And give it a Admin email address. I agree and click on Register. Aha, looks like somebody's already taken that bot handle. So, I'm going to say myCustomTeamsBot3978 to match the port that I'm running on. I'm just trying to come up with a random number. So, 3-9-7-8. Yes, these names need to be unique, unfortunately. So that was a very common name. Let's click Register. And now, hopefully, the bot is created. Okay. So here you go. The bot is created. Now you see that the user experience here is not perfect. It is what it is. This is going to be migrated into Azure Bot Service soon anyway where this page looks fine. I'm not going to worry about this for now. Now I'll add the Teams channel though. See this button here Configure Teams channel. Click on that button and that'll allow you to add Teams channel. Let's look at that next.

Contents