page_type | description | products | languages | extensions | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
sample |
Microsoft Teams meeting extensibility sample - token passing |
|
|
|
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.
NOTE: This capability is currently available in developer preview only.
- 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
- 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.
-
.NET Core SDK version 3.1
# determine dotnet version dotnet --version
-
Nodejs version 10.21.0+ (use the LTS version)
# determine dotnet version node --version
-
Ngrok (Only for devbox testing) Latest (any other tunneling software can also be used)
# run ngrok locally ngrok http -host-header=rewrite 3978
We assume working knowledge of the following technologies to gain full understanding of the app
- C#
- ECMAScript6
- Asp.NET core version 3.1
- React.JS version 16+
The app uses the Teams extensibility features described on the following pages:
- Apps in Teams meetings
- Create apps for Teams meetings
- Tab single sign-on to get the identity of the user accessing the tab, in a way that can be verified in the server APIs
-
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
. -
Register your bot using bot channel registration in Azure AD portal, following the instructions here.
-
Update the AAD app registration for tab SSO, following the instructions here. The "fully qualified domain name" in the instructions will be your ngrok domain.
-
Set up the appsettings.json with the following keys:
"MicrosoftAppId"
: Application (client) ID of the bot's Azure AD application"MicrosoftAppPassword"
: client secret of the bot's Azure AD application"AzureAd"."TenantId"
: Tenant ID of the tenant where the app will be used. Note that the sample will only work in this tenant."AzureAd"."ApplicationId "
: Set to the same value asMicrosoftAppId
above."ContentBubbleUrl "
: Content bubble iframe url (default.https://[WebAppDomain]/contentBubble.html
). Remember that[WebAppDomain]
will be your ngrok domain, so the content bubble URL will be similar tohttps://f631****.ngrok.io/contentBubble.html
.
-
Register a bot with Azure Bot Service, following the instructions here.
- Ensure that you've enabled the Teams Channel
- While registering the bot, use
https://<your_ngrok_url>/api/messages
as the messaging endpoint.NOTE: When you create your bot you will create an App ID and App password - make sure you keep these for later.
Step 2: Add the following entry to the manifest.json (schema reference)
- Set
manifestVersion
to "devPreview" - Add your bot configuration, with the app id of the bot generated from the previous steps
- Fill-in the following
webApplicationInfo
section, usingMicrosoftAppId
andWebAppDomain
values from the previous section."webApplicationInfo": { "id": "[MicrosoftAppId]", "resource": "api://[WebAppDomainName]/[MicrosoftAppId]" }
- Navigate to the
App
folder in a terminal - Run
npm install
- Run
npm run build
to build the app.
This generates the dist folder inside the app where the assets will generated/copied. The server will serve the static files from this location.
```bash
# npx @fluidframework/azure-local-service@latest
```
You can build and run the project from the command line or an IDE:
A) From a command line:
# run the server
cd TokenApp
dotnet run
B) From an IDE:
- Launch Visual Studio
- File > Open > Project/Solution
- Navigate to the
TokenApp
folder - Select
TokenApp.csproj
file - Press
F5
to run the project
Follow these instructions to enable developer preview. Note that Developer preview mode must be enabled on each Teams client app or browser.
In-meeting tabs are only available in the Teams desktop client. They will not be visible when you run Teams in a web browser.
- Create a .zip using the below files, which are in the
Resources/Manifest
folder.
- manifest.json
- icon-outline.png
- icon-color.png
- Create a meeting with few test participants, ideally with a mix of Presenters and Attendees.
- Once meeting is created, go to the meeting details page and click on the "Add tab" (+) button.
- In the pop-up that opens, click on "Manage apps".
- 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.
- Click on the "Add tab" button again. Now in the app selection page, the app should be visible as a "Meeting optimized tab".
- Select the Meeting Token app.
- Now the app will be visible in the meeting chat.
- Start the meeting and the icon should be visible in the meeting control bar.
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.
- Teams Tabs experience
- Tabs SSO
- Bot Framework Documentation
- Bot Basics
- Activity processing
- Azure Bot Service Introduction
- Azure Bot Service Documentation
- .NET Core CLI tools
- Azure CLI
- Azure Portal
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.