Search code examples
pythonauthenticationbotframework

Is it possible to run a teams bot without password or do I have a problem when creating it?


I created a teams bot with the python framework, tested it using the bot emulator locally, then moved it to my server and the using the new endpoint I can discuss with my bot properly from the emulator.

However the config.py file (copied from different sample from Microsoft as this one on github), the documentation here (citing: Your registration needs the messaging endpoint from your deployed web service and your web service needs the ID and password created from your registration.) and other online website or issue I visited ask for a password.

When I registered my bot, I didn't have any password (see the screenshot of my old bot, now deleted, the ID is not a problem). I didn't got any pop-up with my password as some tutorial mention. I don't have any passwords neither on the App registration panel on Microsoft Azure.

enter image description here

So I tried to run the bot without, but while I'm able to read the message from Teams or the Web chat, I get unauthorized errors when trying to answer, and the bot emulator give me an error 401 "The bot's Microsoft App ID or Microsoft App Password is incorrect when trying to enter only the APP ID.

Is the error I am getting when trying to answer the Web Chat or the Teams chat ([on_turn_error] unhandled error: Operation returned an invalid status code 'Unauthorized') caused by my lack of Password, and then how can I get one, or is it a abnormal and a problem in my code?


Solution

  • Bot Framework bots use Azure Active Directory to manage their identities and authenticate themselves. Your bot will need an app ID and password to send messages to any channel except for Bot Framework Emulator.

    Whether you have an active Azure subscription or not, you will still need to use the Azure portal to manage your AAD app registration, which is how you get your password. The password is a client secret that's been added to the app registration, and you can generate one by following the instructions here.