msgext-graph-search has been built using search-based message extension template that allows users to leverages the Graph Search API to search Microsoft 365 data and share results through the compose message area of the Microsoft Teams client. You can now build and run the this message extensions in Teams, Outlook for Windows desktop and web experiences.
MS.Extension.that.leverages.the.Graph.Search.API.to.search.Microsoft.365.data.mp4
- Login and consent in Message Extension
- Use Microsoft Graph API to query Microsoft 365 data with SSO token in Message Extension
- Node.js, supported versions: 16, 18
- A Microsoft 365 account. If you do not have Microsoft 365 account, apply one from Microsoft 365 developer program
- Teams Toolkit Visual Studio Code Extension version 5.0.0 and higher or TeamsFx CLI
Here are the instructions to run the sample in Visual Studio Code.
- Clone the repo to your local workspace or directly download the source code.
- Open the project in Visual Studio Code.
- Open Debug View (
Ctrl+Shift+D
) and selectDebug(Edge)
orDebug(Chrome)
in dropdown list. - Press
F5
finally pop up an window to login your tenant account, and install this Teams App.
Deploy your project to Azure by following these steps:
- Open Teams Toolkit in Visual Studio Code, and sign in your Azure account by clicking the
Sign in to Azure
in theACCOUNTS
section from sidebar. - Open Teams Toolkit and click
Provision
in theLIFECYCLE
section. Alternatively open the command palette(Ctrl+Shift+P) and type:Teams: Provision
command. - Open the Teams Toolkit and click
Deploy
in theLIFECYCLE
section. Alternatively open the command palette(Ctrl+Shift+P) and type:Teams: Deploy
command.
Note: Provision Azure cloud resources and deploy to Azure may cause charges to your Azure Subscription.
After you have completed the provision and deploy steps in Deploy the app to Azure
section, you can preview your app in Teams client by following steps below:
- Open the
Run and Debug Activity
panel from sidebar, or use short key Ctrl+Shift+D. - Select
Launch Remote (Edge)
orLaunch Remote (Chrome)
in the launch configuration (a dropdown selection in the upper-left corner). - Press the
Start Debugging
button to launch your app, the Teams web client will be automatically opened in your browser, where you will see your app running remotely from Azure.
Folder | Contents |
---|---|
.vscode/ |
VSCode files for debugging |
appPackage/ |
Templates for the Teams application manifest |
env/ |
Environment files |
infra/ |
Templates for provisioning Azure resources |
src/ |
The source code for the search application |
The following files can be customized and demonstrate an example implementation to get you started.
File | Contents |
---|---|
src/searchApp.ts |
Handles the business logic for this app template to query npm registry and return result list. |
src/index.ts |
index.ts is used to setup and configure the Message Extension. |
The following are Teams Toolkit specific project files. You can visit a complete guide on Github to understand how Teams Toolkit works.
File | Contents |
---|---|
teamsapp.yml |
This is the main Teams Toolkit project file. The project file defines two primary things: Properties and configuration Stage definitions. |
teamsapp.local.yml |
This overrides teamsapp.yml with actions that enable local execution and debugging. |
Following documentation will help you to extend the template.
- Add or manage the environment
- Create multi-capability app
- Add single sign on to your app
- Access data in Microsoft Graph
- Use an existing Azure Active Directory application
- Customize the Teams app manifest
- Host your app in Azure by provision cloud resources and deploy the code to cloud
- Collaborate on app development
- Set up the CI/CD pipeline
- Publish the app to your organization or the Microsoft Teams app store
- Develop with Teams Toolkit CLI
- Preview the app on mobile clients