Integrate Rasa bot with microsoft teams

The reason you are getting this error is that the endpoint only allows the POST method. It also means your Rasa server has botframework endpoint enabled.

Check if rasa server has botframework enabled (Method: GET, or simply hit the URL in your browser):

Rasa Endpoint: https://{hostname/ip}/webhooks/botframework

Rasa X Endpoint: https://{hostname/ip}/core/webhooks/botframework

Response: {"status":"ok"}

Botframework webhook URL to interact with Rasa server or to set in the Azure (Method: POST):

Rasa Endpoint: https://{hostname/ip}/webhooks/botframework/webhook

Rasa X Endpoint: https://{hostname/ip}/core/webhooks/botframework/webhook

If you want to test the endpoint manually, use the body {"message" : "Testing botframework endpoint", "sender": "username"} for the POST method, and it should return you success with status code 200 OK.

Thanks for the response. what ever you have given tested and in browser as well as in post man the status success and code 200.

next am typing my questions in teams … there is no response.

rasa server logs::

2020-07-01T16:33:18.914+05:30 [APP/PROC/WEB/0] [ERR] File “/home/vcap/deps/0/python/lib/python3.7/site-packages/rasa/core/channels/”, line 230, in webhook

2020-07-01T16:33:18.914+05:30 [APP/PROC/WEB/0] [ERR] if postdata[“type”] == “message”:

2020-07-01T16:33:18.914+05:30 [APP/PROC/WEB/0] [ERR] KeyError: ‘type’

Could you please paste the leading and trailing logs? The error says that postdata dictionary is missing key ‘type’.

You could try using Microsoft Bot Emulator first before integrating it with MS Teams. That way you should be able to get logs on the other side of it.

Also, check if you have set up appropriate API permissions. I have attached my API permission screenshot below for reference.

Thanks for your reply, where we need to set API permissions in azure? could you please provide screen shots for setup API for permission. It is working perfectly fine for ngrok on localhost. when i deploy into Cloud then I am not getting any response and no error in rasa server logs. Webhook api is not allowing rasa server(cloud) application due to organization domain.

The permissions are set up in Azure.

If it is working on your local + ngrok setup, the issue is not there on rasa. It is more of a network firewall related issue. Check if the pings are successful between the servers. If the pings are not going through, check if the ports are open and accepting connections, you can whitelist specific servers to allow the connection.

I have attached the screenshots anyway in case its helpful.

Where i get app password in azure portal?

Hi @nchauras, I was able to work with Microsoft teams when I made the bot available in every domain. But if I wanted my bot to available only to my office domain, what permissions should I add. I have added the 7 permissions as shown in the screenshot. But I’m not able to receive messages in teams as well as webchat. I’m able to see the messages, responses in rasa-x, but responses are being shown in teams and webchat.

Hi Nitin,

Do you know a way to get the MS Teams credentials in the rasa actions so that I can do some user specific actions?

hello, did you find a solution to this?

bot id should be used instead of teams app id. I also did the same mistake and wasted a lot of time, trying to fix authorization error

What to add in the bot handle when I try to register a new bot with Microsoft Bot Framework? If our chatbot is currently being deployed through AWS and it is not registered in the Azure AI Bot Service?

I would like to connect my rasa chatbot with Azure bot service, I have used ngrok to expose my rasa server which is running in localhost 5005, im getting the response in postman while checking the forwarded link that ngrok provides.

I have given ngrok | Unified Ingress Platform for Developers in azure bot confirguration.

But while connnecting with azure bot service, I have given my app_id and app_password provided in azure bot service in credentials.yml file in rasa server and rerun the server and tried testing it in azure web chat, it gives me 401 unauthorized error.

@dumparun Hi Arun, where to find out the bot id

Please provide the details because i’m unable to find it

Did you find out solution to this?

Bot id is nothing but the app id in manifest file of azure