-
Notifications
You must be signed in to change notification settings - Fork 236
How to configure Tab capability within your Teams app
Tabs are Teams-aware webpages embedded in Microsoft Teams. They're simple HTML <iframe> tags that point to domains declared in the app manifest and can be added as part of a channel inside a team, group chat, or personal app for an individual user. You can include custom tabs with your app to embed your own web content in Teams or add Teams-specific functionality to your web content. Learn more from Build tabs for Teams .
To configure tab as additional capability, please make sure:
- You have a Teams application and its manifest.
- You have a Microsoft 365 account to test the application.
Before going on, we strongly suggest you should create and go through a Tab app with Teams Toolkit. Create a Tab app with Teams Toolkit(https://learn.microsoft.com/microsoftteams/platform/toolkit/create-new-project?pivots=visual-studio-code)
Following are the steps to add Tab capability:
- Configure Tab capability in Teams application manifest.
- Setup local debug environment.
- Move the application to Azure.
-
You can configure your tab within group or channel, or personal scope in you Teams application manifest
appPackage/manifest.template.json
. Examples:"staticTabs": [ { "entityId": "index", "name": "Personal Tab", "contentUrl": "${{TAB_ENDPOINT}}/index.html#/tab", "websiteUrl": "${{TAB_ENDPOINT}}/index.html#/tab", "scopes": [ "personal" ] } ],
"configurableTabs": [ { "configurationUrl": "${{TAB_ENDPOINT}}/index.html#/config", "canUpdateConfiguration": true, "scopes": [ "team", "groupchat" ] } ],
-
Add your tab domain to the
validDomains
field. Example:"validDomains": [ "${{TAB_DOMAIN}}" ],
TAB_ENDPOINT
andTAB_DOMAIN
are built-in variables of Teams Toolkit. They will be replaced with the true endpoint in runtime based on your current environment(local, dev, etc.).
-
Bring your Tab app code into your project. If you don't have one, you can create a new Tab app project with Teams Toolkit and copy the source code to into your current project. Your folder structure may be like:
. |-- teasmfx/ |-- infra/ |-- appPackage/ |-- tabs/ <!--tab app source code--> | |-- src/ | | |-- index.tsx | |-- package.json |-- src/ <!--your current source code--> | |-- index.ts |-- package.json
It is suggested to re-organize the folder structure as:
. |-- teasmfx/ |-- infra/ |-- appPackage/ |-- tabs/ <!--tab app source code--> | |-- src/ | | |-- index.tsx | |-- package.json |-- bot/ <!--move your current source code to a new sub folder--> | |-- src/ | | |-- index.ts | |-- package.json
-
Generate debug profile with TeamsFx CLI.
> teamsfx init debug ? Teams Toolkit: Select your development environment: Visual Studio Code (JS/TS) ? Teams Toolkit: Select the capability of your app: Tab ? Teams Toolkit: Are you developing with SPFx?: No ? Teams Toolkit: Teams Toolkit will generate the following files (existing files with duplicated names will be overwritten), would you like to proceed? teamsfx/ - app.local.yml - .env.local - settings.json - run.js .vscode/ - launch.json - settings.json - tasks.json : Yes
-
Manually merge the content in
.vscode
andteamsfx
folder with yours. Update theapp.local.yml
andrun.js
to target your tab app code. Here is an sample project for reference. Hello World Bot with Tab. -
Try local debug with Visual Studio Code.
-
Generate Bicep file for Azure infrastructure with TeamsFx CLI.
> teamsfx init infra ? Teams Toolkit: Select your development environment: Visual Studio Code (JS/TS) ? Teams Toolkit: Select the capability of your app: Tab ? Teams Toolkit: Are you developing with SPFx?: No ? Teams Toolkit: Teams Toolkit will generate the following files (existing files with duplicated names will be overwritten), would you like to proceed? teamsfx/ - app.yml - .env.dev - settings.json infra/ - azure.bicep - azure.parameters.json : Yes
-
Manually merge the content in
infra
andteamsfx
folder with yours. Here is a sample project for reference. Hello World Bot with Tab. -
Run
Teams: Provision in the cloud
command in Visual Studio Code to apply the bicep to Azure. -
Run
Teams: Deploy to cloud
command in Visual Studio Code to deploy your Tab app code to Azure. -
Open the
Run and Debug Activity Panel
and selectLaunch Remote (Edge)
orLaunch Remote (Chrome)
. Press F5 to preview your Teams app.
There are other commonly suggested next steps, for example:
Build Custom Engine Copilots
- Build a basic AI chatbot for Teams
- Build an AI agent chatbot for Teams
- Expand AI bot's knowledge with your content
Scenario-based Tutorials
- Send notifications to Teams
- Respond to chat commands in Teams
- Respond to card actions in Teams
- Embed a dashboard canvas in Teams
Extend your app across Microsoft 365
- Teams tabs in Microsoft 365 and Outlook
- Teams message extension for Outlook
- Add Outlook Add-in to a Teams app
App settings and Microsoft Entra Apps
- Manage Application settings with Teams Toolkit
- Manage Microsoft Entra Application Registration with Teams Toolkit
- Use an existing Microsoft Entra app
- Use a multi-tenant Microsoft Entra app
Configure multiple capabilities
- How to configure Tab capability within your Teams app
- How to configure Bot capability within your Teams app
- How to configure Message Extension capability within your Teams app
Add Authentication to your app
- How to add single sign on in Teams Toolkit for Visual Studio Code
- How to enable Single Sign-on in Teams Toolkit for Visual Studio
Connect to cloud resources
- How to integrate Azure Functions with your Teams app
- How to integrate Azure API Management
- Integrate with Azure SQL Database
- Integrate with Azure Key Vault
Deploy apps to production