| page_type | sample | ||||
|---|---|---|---|---|---|
| description | Microsoft Teams tab sample app for demonstrating tab in stage view | ||||
| products |
|
||||
| languages |
|
||||
| extensions |
|
||||
| urlFragment | officedev-microsoft-teams-samples-tab-stage-view-nodejs |
This App talks about the Teams tab in stage view with Nodejs. For reference please check Tabs link unfurling and Stage View
-
Office 365 tenant. You can get a free tenant for development use by signing up for the Office 365 Developer Program.
-
To test locally, NodeJS must be installed on your development machine (version 16.14.2 or higher).
# determine node version node --version -
To test locally, you'll need Ngrok installed on your development machine. Make sure you've downloaded and installed Ngrok on your local machine. ngrok will tunnel requests from the Internet to your local computer and terminate the SSL connection from Teams.
NOTE: The free ngrok plan will generate a new URL every time you run it, which requires you to update your Azure AD registration, the Teams app manifest, and the project configuration. A paid account with a permanent ngrok URL is recommended.
-
Setup for Bot
- Register Azure AD application
- Register a bot with Azure Bot Service, following the instructions here.
- While registering the bot, use
https://<your_ngrok_url>/api/messagesas the messaging endpoint.
NOTE: When you create your app registration in Azure portal, you will create an App ID and App password - make sure you keep these for later.
-
Setup NGROK
-
Run ngrok - point to port
3978ngrok http -host-header=localhost 3978
- Setup for code
-
Clone the repository
git clone https://github.com/OfficeDev/Microsoft-Teams-Samples.git
-
In a console, navigate to
samples/tab-stage-view/nodejsfolder -
Install modules
npm install
-
Update the
.envconfiguration for the bot to use theMicrosoftAppId(Microsoft App Id) andMicrosoftAppPassword(App Password) from the Azure bot registration in Azure portal or Bot Framework registration. Also updateBaseUrlaccording to your code runtime environment.
NOTE: the App Password is referred to as the
client secretin the azure portal and you can always create a new client secret anytime.
-
Run your bot at the command line:
npm start
-
Install modules & Run the NodeJS Server
-
Server will run on PORT: 3978
-
Open a terminal and navigate to project root directory
npm run server
-
-
This command is equivalent to: npm install > npm start
-
Setup Manifest for Teams
-
This step is specific to Teams.
- Edit the
manifest.jsonin theManifestfolder and replace the following details: <<MANIFEST-ID>>with some unique GUID orMicrosoftAppId<<BASE-URL>>with your application's base url, e.g. https://1234.ngrok.io<<YOUR-MICROSOFT-APP-ID>>with theMicrosoftAppIdreceived from AAD app registration in Azure portal.<<DOMAIN-NAME>>with the ngrok URL or app hosted base url. Note: If you want to test your app across multi hub like: Outlook/Office.com, please update themanifest.jsonin thetab-stage-view\nodejs\Manifest_Hubfolder with the required values.- Zip up the contents of the
Manifestfolder to create aManifest.ziporManifest_Hubfolder to create aManifest_Hub.zip - Upload the
manifest.zipto Teams (in the Apps view click "Upload a custom app") - Go to Microsoft Teams. From the lower left corner, select Apps - From the lower left corner, choose Upload a custom App - Go to your project directory, the ./Manifest folder, select the zip folder, and choose Open. - Select Add in the pop-up dialog box. Your tab is uploaded to Teams.
- Edit the
- In the navigation bar located at the far left in Teams, select the ellipses ●●● and choose your app from the list.
Welcome message with feature explanation and Adaptive Card with actions:
Opening stage view from Adaptive Card Action:
Opening stage view from Adaptive card via deep link:
Tab with execute deep link action to open stage view:
-
To view your app in Outlook on the web.
-
Go to Outlook on the weband sign in using your dev tenant account.
On the side bar, select More Apps. Your sideloaded app title appears among your installed apps
Select your app icon to launch and preview your app running in Outlook on the web
Note: Similarly, you can test your application in the Outlook desktop app as well.
-
To preview your app running in Office on the web.
-
Log into office.com with test tenant credentials
Select the Apps icon on the side bar. Your sideloaded app title appears among your installed apps
Select your app icon to launch your app in Office on the web
Note: Similarly, you can test your application in the Office 365 desktop app as well.
To learn more about deploying a bot to Azure, see Deploy your bot to Azure for a complete list of deployment instructions.
- Ensure that you've enabled the Teams Channel
- Bot Framework Documentation
- Bot Basics
- User Specific Views
- Sequential Workflows
- Up to date cards
- Universal Bot Action Model
- Azure Portal
- Activity processing
- Azure Bot Service Introduction
- Azure Bot Service Documentation
- Azure CLI
- Azure Portal
- Language Understanding using LUIS
- Channels and Bot Connector Service
- dotenv
- Microsoft Teams Developer Platform
- Extend Teams apps across Microsoft 365








