This project is tabs app add-in for Microsoft Teams.
- Client side: ReactJS
- Server side: NodeJS
- NodeJS
- An M365 account. If you do not have M365 account, apply one from M365 developer program
- Teams Toolkit Visual Studio Code Extension version after 1.55 or TeamsFx CLI
If you want to run in localhost, you can use 2 options.
- With server-side code
- Without server-side code: SSO authentication provided by teams toolkit
- Install package
npm run installAll - Register new App in Portal Azure
You can hit the
F5key in VS Code (Teams tookit will auto create new app and setup everything) or create by yourself Register an Azure AD App - Edit
.envfor tabs
- Open folder
tabs - Open your app in 2. and copy
Application (client) ID - copy
.env.sampleand rename file to.env. Then paste your App id inREACT_APP_CLIENT_ID
- Upadate
Application (client) IDinauth-start.html(client side) - Edit
.envfor server
- Open folder
server - Open your app in 2. and copy
Certificates value(3rd column in below figure). If you can't copy value, you can create new one (clickNew client secret) - copy
.env.sampleand rename file to.env. Then paste your App id inCLIENT_IDand Certificates value inCLIENT_SECRET
- Run client side (tabs) in local
cd tabsandnpm run start - Run server side in local
cd serverandnpm run start - Upload Manifest
- go to folder
manifest - copy file
manifest.sample.jsonand rename tomanifest.json - cd .fx/states/state.local.json and copy value
{{fx-resource-appstudio.teamsAppId}}= teamsAppId{{localSettings.auth.clientId}}= clientId{{{localSettings.auth.applicationIdUris}}}= applicationIdUris - If you have no localSetting.json, hitting
F5or you can copy value from your app overview in Portal Azure (teamsAppId can be any value in format xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx) - Compress manifest.json and folder resources to zip file.
- open MS Teams app in browser. Then click Apps> Upload a custom app and upload your zip file
- go to folder
- npm run installAll
- hitting the
F5key in Visual Studio Code.
cd serverandnpm run start- Install ngrok and run
ngrok http 55000
- Copy your path forwarding
https://xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx.ngrok.io
Firebase Tutorial - How to Set Up and Deploy with ReactJS
cd tabs- Copy
.env.sample.productionand rename to.env.production - Change
REACT_APP_TEAMSFX_ENDPOINTto ngrok path forwarding npm run build:productionfirebase deploy
NOTE: If you use free version ngrok, the path was change after you terminate the server side.
So you must update .env.production, npm run build:production, and deploy
-
cd manifestProd -
copy file
manifest.sample.jsonand rename tomanifest.json -
edit
https://tab-sso-client.web.appto your client domain -
edit
webApplicationInfo.resourcetoapi://{your-client-domain}/{your-app-client-id-from-portalAzure}such asapi://tab-sso-client.web.app/84a71487-45a8-4504-8aa5-e5xxxxxxxxxx -
Add
redirectUriin Portal Azure
NOTE: It must be your client domain -
Update
Expose APIin portal Azure. The value be the same as 4.
NOTE: If webApplicationInfo.resourcenot be the same asexpose apiin azure portal, the error resourceDisabled was found. -
Compress manifefst to zip and upload in MS Teams for testing.
You can find the Teams app manifest in templates/appPackage folder. The folder contains two manifest files:
manifest.local.template.json: Manifest file for Teams app running locally.manifest.remote.template.json: Manifest file for Teams app running remotely (After deployed to Azure).
Both files contain 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 TeamsFx CLI |
|---|---|
|
|
Note: Provisioning and deployment may incur charges to your Azure Subscription.
To check that your manifest file is valid:
- From Visual Studio Code: open the Teams Toolkit and click
Validate manifest fileor open the command palette and select:Teams: Validate manifest file. - From TeamsFx CLI: run command
teamsfx validatein your project directory.

