Search code examples
asp.net-coreazure-devopsbotframeworkmicrosoft-teams

Sending Proactive Messages on Microsoft Teams with Bot framework


I installed a chatbot on Teams built with a bot framework. I am using Azure DevOps to update changes to the bot.

I want to send proactive messages to users following this Microsoft documentation and example code. But I don't know how to call the /api/notify endpoint.

How can I call the https://xxxxxx.azurewebsites.net/api/notify from within my code to send proactive messages to users on Teams?


Solution

  • One thing I don't like about this sample is that it makes it seem like you need to host the -ability- to make a pro-active call inside the same web host as your bot itself, which is definitely not required. You could, for instance, have your bot hosted in web application, but make a pro-active call from an Azure Function directly. That's one of the reasons I put together a different sample - check it out here. It requires only a service url (because the endpoint can change based on the tenant's geography, for instance) and a "conversation id" so that it know which user/group/channel to message to. Please check it out and see if it helps.