Sample code for Microsoft Teams application with SSO, Bots, Messaging extensions and other capabilities.
This sample is a Search messaging extension created from using the core teams application built over the course of labs A01-A03 to get to the Northwind Orders core application. It inserts information about Northwind products into the compose box where team members can update stock value.
Users can search the Northwind database when composing a message and find the product.
Select a product and insert an adaptive card which is a form with product details and stock input, into the conversation.
The members in the team can then update stock information in the same conversation, by adding stock unit value in the input field and select Update stock.
Once it’s successfully updated, the card refreshes to show the new stock value.
Version | Date | Author | Comments |
---|---|---|---|
1.0 | February 2022 | Rabia Williams | Initial release |
THIS CODE IS PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
Clone or download the sample from https://github.com/OfficeDev/m365-msteams-northwind-app-samples
In a console, navigate to src/extend-with-capabilities/MessagingExtension/
from the main folder m365-msteams-northwind-app-samples
.
cd src/extend-with-capabilities/MessagingExtension/
Install modules
npm install
Download your local DB copy (Do this only once)
npm run db-download
Run ngrok - point to port 3978
ngrok http -host-header=rewrite 3978
Since messaging extensions utilize the Bot Framework, you will need to register a new bot. Follow these instructions.
Update the .env
configuration for the bot to use the Bot id and Client secret.
BOT_REG_AAD_APP_ID=<Bot id> BOT_REG_AAD_APP_PASSWORD=<Client Secret>
Package the app
npm run package
npm start
Upload the the packaged zip file inside manifest
folder into Teams using these instructions.
This is a simple Search messaging extension to show case how you can search and display data from a third party data base in Microsoft Teams. It also shows how you can update data in the third party data base all in the same conversation.
TBD