0

I am getting this error when I send message through teams bot. How to configure my authentication on azure app? I get proper response in Bot emulator when not connected with Azure app. But when connected it fails. Can anyone give me step by step process on how to authenticate users so I can get response on the Teams Bot. I looked a lot but nobody explains it clearly.

Details of what I am trying to do :

  1. Created MS Teams bot using BotFramework
  2. I send message on Teams bot which goes to Botframework
  3. BotFramework transfers this request to my application using ngrok endpoint
  4. My application sends back response to BotFramework
  5. BotFramework sends back response to Teams which I see as the Bot's reply

Where the problem is : on 5th step, BotFrameWork gives this Error.

Rajeesh Menoth
  • 1,704
  • 3
  • 17
  • 33
Saransh96
  • 1
  • 1
  • Does this answer your question? [TEAMS bot in node.js: 'Authorization has been denied for this request' in CreateConversation method](https://stackoverflow.com/questions/58431605/teams-bot-in-node-js-authorization-has-been-denied-for-this-request-in-create) – Rajeesh Menoth Jul 27 '21 at 17:07
  • Also you can verify this so reference : https://stackoverflow.com/questions/60920689/bot-fails-to-authenticate-after-restart-with-saved-conversation-reference-and-ca – Rajeesh Menoth Jul 27 '21 at 17:10
  • You can double-check if you are trusting the serviceUrl. Refer to https://learn.microsoft.com/en-us/azure/bot-service/bot-builder-howto-proactive-message?view=azure-bot-service-4.0&tabs=csharp#avoiding-401-unauthorized-errors and https://github.com/MicrosoftDocs/bot-docs/issues/1860 for more details. – ranusharao Jul 27 '21 at 21:29
  • The reference link solution is to use MicrosoftAppCredentials.trustServiceUrl(serviceUrl); which is now deprecated. – Saransh96 Jul 29 '21 at 08:18
  • Hey, Have you checked out simple [Echo bot sample](https://github.com/microsoft/BotBuilder-Samples/tree/main/samples/csharp_dotnetcore/02.echo-bot)? Try this out and see if you are getting response. – Hunaid Hanfee-MSFT Jul 29 '21 at 19:33
  • @HunaidHanfee-MSFT Same problem in bot sample too – Saransh96 Aug 11 '21 at 07:10
  • The botId and Password are those updated in bot channel registration? and Is it connected to Teams? – Hunaid Hanfee-MSFT Aug 11 '21 at 10:12

0 Answers0