Skip to content

Latest commit

 

History

History
235 lines (177 loc) · 14.1 KB

File metadata and controls

235 lines (177 loc) · 14.1 KB
page_type description products languages extensions urlFragment
sample
Microsoft Teams meeting extensibility sample - token passing
office-teams
office
office-365
nodejs
contentType createdDate
samples
07/07/2021 01:38:27 PM
officedev-microsoft-teams-samples-meetings-token-app-nodejs

Meeting Token Generator

The Meeting Token Generator app is a sample Microsoft Teams app that extends meetings in Teams. Through this app, meeting participants can request a "token", which is generated sequentially so that each participant has a fair opportunity to interact. This can be useful in situations like scrum meetings, Q&A sessions, etc. This application also shows the implementation of Live Share SDK to update the data in real-time for all participants in meeting.

Included Features

  • Meeting Chat
  • Meeting Details
  • Meeting SidePanel
  • Live Share SDK
  • RSC Permissions
  • Theme Handler

NOTE: This capability is currently available in developer preview only.

Key features

  • Display the current token that is being serviced in the meeting
  • Display the user list sorted by the token number in ascending order
  • Generate a token for the user upon request
  • Display the current user's token number
  • Mark a token as done by the user
  • Skip the current token for the organizer of the meeting

config_page

chat_page

pre_meeting_tab

side_panel_tab

Interaction with app theme

Preview Image

Try it yourself - experience the App in your Microsoft Teams client

Please find below demo manifest which is deployed on Microsoft Azure and you can try it yourself by uploading the app package (.zip file link below) to your teams and/or as a personal app. (Sideloading must be enabled for your tenant, see steps here).

Meetings Token App: Manifest

Prerequisites

Tools

  • Nodejs version 10.21.0+ (use the LTS version)

    # determine dotnet version
    node --version
  • dev tunnel or ngrok (For local environment testing) latest version (any other tunneling software can also be used)

  • dev tunnel or Ngrok (Only for devbox testing) Latest (any other tunneling software can also be used)

Run the app (Using Teams Toolkit for Visual Studio Code)

The simplest way to run this sample in Teams is to use Teams Toolkit for Visual Studio Code.

  1. Ensure you have downloaded and installed Visual Studio Code
  2. Install the Teams Toolkit extension
  3. Select File > Open Folder in VS Code and choose this samples directory from the repo
  4. Using the extension, sign in with your Microsoft 365 account where you have permissions to upload custom apps
  5. Select Debug > Start Debugging or F5 to run the app in a Teams web client.
  6. In the browser that launches, select the Add button to install the app to Teams.

If you do not have permission to upload custom apps (sideloading), Teams Toolkit will recommend creating and using a Microsoft 365 Developer Program account - a free program to get your own dev environment sandbox that includes Teams.

Technologies

We assume working knowledge of the following technologies to gain full understanding of the app

The app uses the Teams extensibility features described on the following pages:

Note: If you are facing any issue in your app, please uncomment this line and put your debugger for local debug.

Setup

Step 1: Register Azure AD applications

  1. Start an ngrok session as indicated above. Note the ngrok domain, as you will use this in the registration steps below, where it will be the value of WebAppDomain.
  2. Register your bot with Azure Bot Service, following the instructions here.
  1. Update the Microsoft Entra ID app registration for tab SSO, following the instructions here. The "fully qualified domain name" in the instructions will be your ngrok domain.
  2. Set up the .env with the following keys:
    • "BotId" : Application (Bot) ID of the bot's Azure AD application
    • "BotPassword" : client secret of the bot's Azure AD application
    • "clientId" : Application (client) ID of the bot's Azure AD application
    • "clientSecret" : client secret of the Azure AD application
    • "baseUrl" : Base URI of the Application

If your Bot and Azure Application are same then the 'BotId' & 'clientId' will be same and 'BotPassword' & 'clientSecret' will be same

Step 2: Add the following entry to the manifest.json (schema reference)

  1. Add your bot configuration, with the app id of the bot generated from the previous steps
  2. Fill-in the following webApplicationInfo section, using MicrosoftAppId and WebAppDomain values from the previous section.
    "webApplicationInfo": {  
      "id": "[MicrosoftAppId]",  
      "resource": "api://[WebAppDomainName]/[MicrosoftAppId]"  
    }

Step 3: Run Ngrok or Dev Tunnel

  1. The application (client) will run on port 3978

  2. Run ngrok - point to port 3978

    ngrok http 3978 --host-header="localhost:3978"

    Alternatively, you can also use the dev tunnels. Please follow Create and host a dev tunnel and host the tunnel with anonymous user access command as shown below:

    devtunnel host -p 3978 --allow-anonymous

Step 4: Run Client & the Server

You can build and run the project from the command line or an IDE:

  1. Navigate to the Project root folder
  2. Build Client
    • Open terminal
    • npm run build
  3. Run Client
    • Open new terminal
    • npm run client
    • The client will start running on 3978 port
  4. Run Server
    • Open new terminal
    • npm run server
    • The server will start running on 3000 port
  5. Update the manifest .zip file under appManifest folder
    • npm run manifest
  6. Now your application is running and ready to upload

Step 5: Enable developer preview in your desktop Teams client

Follow these instructions to enable developer preview. Note that Developer preview mode must be enabled on each Teams client app or browser.

Note: Open the meeting chat section and type @MeetingTokenApp Hello (It will send back the required information to you).

In-meeting tabs are only available in the Teams desktop client. They will not be visible when you run Teams in a web browser.

Step 6: Sideload the app in a Teams desktop client

  1. Create a .zip using the below files, which are in the appManifest folder.
  • manifest.json
  • icon-outline.png
  • icon-color.png
  1. Create a meeting with few test participants, ideally with a mix of Presenters and Attendees.
  2. Once meeting is created, go to the meeting details page and click on the "Add tab" (+) button.
  3. In the pop-up that opens, click on "Manage apps".
  4. Click on "Upload a custom app" and upload the .zip file that was created in the previous steps. This adds the app to the meeting.
  5. Click on the "Add tab" button again. Now in the app selection page, the app should be visible as a "Meeting optimized tab".
  6. Select the Meeting Token app.
  7. Now the app will be visible in the meeting chat.
  8. Start the meeting and the icon should be visible in the meeting control bar.

Running the sample

User interactions

  • Token - Requests a token for the user
  • Done - Acknowledges that the user is done with the token
  • Skip - Skips the current user and moves on to the next person in line for a token. This button is only shown to users with the meeting Organizer role.

Interactions with app theme

Preview Image

Preview Image

Preview Image

Troubleshooting

The sample app uses an in-memory store to maintain token information and the service URL for the tenant. If you restart the project, you must run the following command to recapture the service URL: @[BotName] reset

In your own projects, please use a durable storage mechanism to store the service URL for the tenant.

Deploy to Azure

Deploy your project to Azure by following these steps:

From Visual Studio Code From TeamsFx CLI
  • Open Teams Toolkit, and sign into Azure by clicking the Sign in to Azure under the ACCOUNTS section from sidebar.
  • After you signed in, select a subscription under your account.
  • Open the Teams Toolkit and click Provision from DEPLOYMENT section or open the command palette and select: Teams: Provision.
  • Open the Teams Toolkit and click Deploy or open the command palette and select: Teams: Deploy.
  • Run command teamsfx account login azure.
  • Run command teamsfx provision --env dev.
  • Run command: teamsfx deploy --env dev.

Note: Provisioning and deployment may incur charges to your Azure Subscription.

Further reading

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.

When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.