feat: Microsoft Teams Integration#7150
Conversation
Currently using adminconsent and evidence for integration is just a tenantId that we store on the workspace. The above is subject to change
|
update session, alert and error alert pages to allow setting teams channel
register endpoint to receive teams events implement teams integration with links to conversation reference and stuff finalize relevant environment variables
…nvo will be limited. introduce support for new session alert (TESTED) and ErrorFeedback alert (UNTESTED)
- 4 bot messages are pending testing.
…etching team channels
setup and sending of messages works there are three messages pending tests
fix bugs in ms teams bot messages
…teams-bot-merge
jemiluv8
left a comment
There was a problem hiding this comment.
Self Review completed
|
I've introduced support for fetching the ms teams channels directly from the microsoft graph api. |
|
thanks @jemiluv8 , testing this today |
|
@jemiluv8 just made a couple more changes - I stopped saving the groups with the workspace and instead just save tenant id, then use the Should be good to merge in now, I'll make sure it gets merged in / passes checks. Thanks for all your work here! |
Just to clarifyThe changes look good to me. One issue with fetching all teams(under the tenant) and then all channels is that we cannot send to a channel until the bot is installed on the team. At the moment, we don't "default install" the bot on all teams under the tenant. This meansSo we can setup an alert to be sent to a teams channel that will not receive the message if the bot is not installed on the "team" ConclusionThat was the reason I was storing the list of teams the bot was installed on in the workspace. So I only fetch the channels for these teams. Also, when a bot is uninstalled from a team, we remove the team from the list of teams. That fixes the above issue to some extent. OptionsOne thing we could do is to "auto install" the teams bot on all teams in the channel. |
|
@jemiluv8 thanks for the additional context, I just added another check to verify that our app is installed in the team by using this api. Not great because it's a 2n+1 query, but in testing this took about 2s which should be fine as it's only when loading the alerts page for users with many team. We can look at optimizing in the future if this becomes a user pain point, but it keeps all the state of which teams our bot is installed on on the MS Teams side so there's no issue of keeping our state in sync. Will merge this in today |
|
Your update works just fine and fixes the issues I outlined in the clarification. Your preference for not having some state to keep in sync helps avoid a lot of problems At the same time too doing all this exxtra work to sync state over time can lead to bugs that we may have a hard time I’ll keep this in mind for future work on integrations. Its been cool collaborating on this. |
Head branch was pushed to by a user without write access
|
/tip @jemiluv8 200 |
|
/tip $200 @jemiluv8 |
|
🎉🎈 @jemiluv8 has been awarded $200! 🎈🎊 |





Summary
Microsoft teams bot integration
fixes #6858
ROADMAP
How did you test this change?
Highlight UI Integration
Bot Integration
Local Testing
Setting Up the bot
Teams App Installation
To install the teams bot - before it is published - follow the instructions here
A sample manifest can be found at https://drive.google.com/file/d/1JRp6vT_2wRaDu4bMBsrOdH_M5zcY5ApP/view?usp=sharing. That is specific to my app so you'd need to unzip the file, make your bot specific modifications and then zip it.
Are there any deployment considerations?
New Environment Variables
MICROSOFT_TEAMS_BOT_PASSWORD (This is the same as the client secret generated for you microsoft application)
MICROSOFT_TEAMS_BOT_ID
Api Permissions
Ensure the Application has the following api permissions

New Workspace Fields
MicrosoftTeamsTenantId *string
MicrosoftTeamsChannels *string
Complete Demo
The link below demonstrates integration and bot setup.
We cannot initiate bot installation from the UI until the bot is "published" to the microsoft store.
https://drive.google.com/file/d/1jR_2o1LkCcjH-Q8LQgD4qIEUo6k4Re1g/view?usp=sharing
Sample Messages
Does this work require review from our design team?
Not yet