page_type | languages | products | name | urlFragment | description | extensions | |||||
---|---|---|---|---|---|---|---|---|---|---|---|
sample |
|
|
Hello World Teams Tab and Outlook add-in |
officedev-teamsfx-samples-tab-hello-world-teams-tab-and-outlook-add-in |
A hello world project that contains both Teams Tab and Outlook add-in capability. |
|
Microsoft Teams supports the ability to run web-based UI inside "custom tabs" that users can install either for just themselves (personal tabs) or within a team or group chat context.
Outlook add-ins are integrations built by third parties into Outlook by using our web-based platform.
Now you have the ability to create a single unit of distribution for all your Microsoft 365 extensions by using the same manifest format and schema, based on the current JSON-formatted Teams manifest.
- How a Teams Tab and an Outlook add-in share the same JSON manifest in one project.
- Node.js, supported versions: 16, 18
- Edge or Chrome installed for debugging Teams Tab. Edge installed for debugging Outlook add-in.
- Outlook for Windows: Beta Channel, Build 16320 or higher. Follow this link for information about how to update channels and check your Outlook client build version.
- An M365 account. If you do not have M365 account, apply one from M365 developer program
- Teams Toolkit Visual Studio Code Extension version 5.0.0 and higher or Teams Toolkit CLI
-
From Visual Studio Code: Start debugging the project by hitting the
F5
key in Visual Studio Code. -
Alternatively use the
Run and Debug Activity Panel
in Visual Studio Code, select the appropriate configuration, and click theRun and Debug
green arrow button. -
From Teams Toolkit CLI: Start debugging the project by executing the command
teamsapp preview --env local
in your project directory.After installing the app in Teams when prompted, it will launch and you'll be able to view the tab app.
-
Please note that the same M365 account should be used both in Teams Toolkit and Outlook.
-
From Visual Studio Code only: use the
Run and Debug Activity Panel
in Visual Studio Code, selectDebug in Outlook Desktop (Edge Chromium)
, and click theRun and Debug
green arrow button. Please run VSCode as administrator if localhost loopback for Microsoft Edge Webview hasn't been enabled. Once enbaled, administrator priviledge is no longer required.Once the Outlook app is open, select a mailbox item, and you can then use the Outlook add-in. For example, you can select the option to show a task pane.
You can find the app manifest in ./appPackage
folder. The folder contains one manifest file:
manifest.json
: Manifest file for Teams app running locally or running remotely (After deployed to Azure).
This file contains template arguments with ${{...}}
statements which will be replaced at build time. You may add any extra properties or permissions you require to this file. See the schema reference for more information.
Deploy your project to Azure by following these steps:
From Visual Studio Code | From Teams Toolkit CLI |
---|---|
|
|
Note: Provisioning and deployment may incur charges to your Azure Subscription.
Once the provisioning and deployment steps are finished, you can preview your Teams app:
-
From Visual Studio Code
- Open the
Run and Debug Activity Panel
. - Select
Launch Remote in Teams (Edge)
orLaunch Remote in Teams (Chrome)
from the launch configuration drop-down. - Press the Play (green arrow) button to launch your app - now running remotely from Azure.
- Open the
-
From Teams Toolkit CLI: execute
teamsapp preview --env dev
in your project directory to launch your application.
Once the provisioning and deployment steps are finished, you can preview your Outlook add-in from Visual Studio Code:
- Copy the production URL from the
TAB_ENDPOINT
in env/.env.dev file. - Edit webpack.config.js file and change urlProd to the value you just copied. Please note to add a '/' at the end of the URL.
- Run
npm run build:add-in
. - Copy
add-in\dist\manifest.dev.json
toappPackage
folder usingnpx ncp .\add-in\dist\manifest.dev.json .\appPackage\manifest.addinPreview.json
- Run
npx office-addin-dev-settings sideload .\appPackage\manifest.addinPreview.json
To check that your manifest file is valid:
- From Visual Studio Code: open the command palette and select:
Teams: Validate Application
and selectValidate using manifest schema
. - From Teams Toolkit CLI: run command
teamsapp validate
in your project directory.
- From Visual Studio Code: open the Teams Toolkit and click
Zip Teams app package
or open the command palette and selectTeams: Zip Teams app package
. - Alternatively, from the command line run
teamsapp package
in the project directory.
Date | Author | Comments |
---|---|---|
March 13, 2023 | yefuwang | onboard |
April 11, 2023 | yufuwang | comment out manifest validation |
May 24, 2023 | yefuwang | update outdated content |
September 10, 2023 | joshuapa | added images |
We really appreciate your feedback! If you encounter any issue or error, please report issues to us following the Supporting Guide. Meanwhile you can make recording of your journey with our product, they really make the product better. Thank you!