How to create bot with Bot Framework

Brass Contributor

What am I trying to do:

Create a chatbot that will receive events like messages. Reply or do some action. These actions are editing Team channels/members.

What I have done already:

I have created a bot server with Flas and Bot Framework for Python

And I created a "bot account" in two ways:

  • Creating App Registry on Azure -> Creating Manifest on App Studio -> Upload it to teams
  • Creating App Registry on Azure -> Creating bot via -> Open it in Teams.

In two cases, the bot is not working:




PermissionError: [Errno Unauthorized. Invalid AppId passed on token: ] <ID of App created in App Registrations>




Of course, it's working on Emulator. Hare is my server code:
I do not have an Azure subscription. Can someone tell me what am I doing wrong? And how to do it right? Thanks!

5 Replies

I think Im know why error occurs I think this ID must be from Bot Service not from App Registrations on Active Directory. if Im right, how to create this bot without subscription?

@norxnd Could you please look at Create a Bot with Microsoft Teams?

You can register your Bot at and use the Microsoft App ID as Bot Id.

@Trinetra-MSFTMicrosoft App ID, you mean this app created in App Registrations?


I have done it but there is the same problem. But now this ID is Bot ID from Bot menagement from VS Code!

The problem has been solved. You must create an app in App Studio and a new bot in the Bots tab. Get ID and generate a password and then add it to the Adapter class!