How to create bot with Bot Framework

%3CLINGO-SUB%20id%3D%22lingo-sub-1856639%22%20slang%3D%22en-US%22%3EHow%20to%20create%20bot%20with%20Bot%20Framework%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1856639%22%20slang%3D%22en-US%22%3E%3CP%3E%3CSTRONG%3EWhat%20am%20I%20trying%20to%20do%3A%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3ECreate%20a%20chatbot%20that%20will%20receive%20events%20like%20messages.%20Reply%20or%20do%20some%20action.%20These%20actions%20are%20editing%20Team%20channels%2Fmembers.%3C%2FP%3E%3CP%3E%3CSTRONG%3EWhat%20I%20have%20done%20already%3A%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3EI%20have%20created%20a%20bot%20server%20with%20Flas%20and%20Bot%20Framework%20for%20Python%3C%2FP%3E%3CP%3EAnd%20I%20created%20a%20%22bot%20account%22%20in%20two%20ways%3A%3C%2FP%3E%3CUL%3E%3CLI%3ECreating%20App%20Registry%20on%20Azure%20-%26gt%3B%20Creating%20Manifest%20on%20App%20Studio%20-%26gt%3B%20Upload%20it%20to%20teams%3C%2FLI%3E%3CLI%3ECreating%20App%20Registry%20on%20Azure%20-%26gt%3B%20Creating%20bot%20via%20dev.botframework.com%2Fbots%2Fnew%20-%26gt%3B%20Open%20it%20in%20Teams.%3C%2FLI%3E%3C%2FUL%3E%3CP%3EIn%20two%20cases%2C%20the%20bot%20is%20not%20working%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-python%22%3E%3CCODE%3EPermissionError%3A%20%5BErrno%20Unauthorized.%20Invalid%20AppId%20passed%20on%20token%3A%20%5D%20%3CID%20of%3D%22%22%20app%3D%22%22%20created%3D%22%22%20in%3D%22%22%20app%3D%22%22%20registrations%3D%22%22%3E%3C%2FID%3E%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EOf%20course%2C%20it's%20working%20on%20Emulator.%20Hare%20is%20my%20server%20code%3A%20%3CA%20href%3D%22https%3A%2F%2Frepl.it%2F%40NORXND%2Fteams%3Flite%3Dtrue%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3Ehttps%3A%2F%2Frepl.it%2F%40NORXND%2Fteams%3Flite%3Dtrue%3C%2FA%3E%3CBR%20%2F%3EI%20do%20not%20have%20an%20Azure%20subscription.%20Can%20someone%20tell%20me%20what%20am%20I%20doing%20wrong%3F%20And%20how%20to%20do%20it%20right%3F%20Thanks!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1856639%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EChat%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EDeveloper%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMicrosoft%20Teams%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1858357%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20create%20bot%20with%20Bot%20Framework%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1858357%22%20slang%3D%22en-US%22%3E%3CP%3EI%20think%20Im%20know%20why%20error%20occurs%20I%20think%20this%20ID%20must%20be%20from%20Bot%20Service%20not%20from%20App%20Registrations%20on%20Active%20Directory.%20if%20Im%20right%2C%20how%20to%20create%20this%20bot%20without%20subscription%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1859667%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20create%20bot%20with%20Bot%20Framework%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1859667%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F845237%22%20target%3D%22_blank%22%3E%40norxnd%3C%2FA%3E%26nbsp%3BCould%20you%20please%20look%20at%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fmicrosoftteams%2Fplatform%2Fbuild-your-first-app%2Fbuild-bot%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%22%3ECreate%20a%20Bot%20with%20Microsoft%20Teams%3F%20%3C%2FA%3E%3C%2FP%3E%0A%3CP%3EYou%20can%20register%20your%20Bot%20at%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fmicrosoftteams%2Fplatform%2Fbots%2Fhow-to%2Fcreate-a-bot-for-teams%23in-the-legacy-portal%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%22%3Edev.botframework.com%3C%2FA%3E%20and%20use%20the%20Microsoft%20App%20ID%20as%20Bot%20Id.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1859855%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20create%20bot%20with%20Bot%20Framework%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1859855%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F371090%22%20target%3D%22_blank%22%3E%40Trinetra-MSFT%3C%2FA%3EMicrosoft%20App%20ID%2C%20you%20mean%20this%20app%20created%20in%20App%20Registrations%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional 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 dev.botframework.com/bots/new -> 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: https://repl.it/@NORXND/teams?lite=true
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 dev.botframework.com and use the Microsoft App ID as Bot Id.

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

@Trinetra-MSFT 

I have done it https://docs.microsoft.com/en-us/microsoftteams/platform/build-your-first-app/build-bot 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!

www.000webhost.com