Skip to content

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
page_type description products languages extensions urlFragment
sample
Microsoft Teams tab sample app for demonstrating graph toolkit component
office-teams
office
office-365
csharp
contentType createdDate
samples
11/11/2021 11:30:17 PM
officedev-microsoft-teams-samples-tab-graph-toolkit-csharp

Teams tab with microsoft graph toolkit

This is the demo app for Teams tab using miscrosoft graph toolkit

Interaction with app

Module

Prerequisites

  • .NET Core SDK version 6.0

    determine dotnet version

    dotnet --version
  • Ngrok (For local environment testing) Latest (any other tunneling software can also be used)

  • Teams Microsoft Teams is installed and you have an account

Setup

  1. Register a new application in the Azure Active Directory – App Registrations portal.

NOTE: When you create your app registration, you will create an App ID and App password - make sure you keep these for later.

  • Register your app with Microsoft identity platform via the Azure AD portal
  • Your app must be registered in the Azure AD portal to integrate with the Microsoft identity platform. See Register an application with the Microsoft identity platform.
  • Click on Add a Platform in redirect URI section.
  • Select Single Page Application and add following URL <<base-url>>/tabauth
  • Save and register.
  • Once App is registerd copy the client_Id for your app and update in the app.
  1. Setup NGROK
  • Run ngrok - point to port 3978
 ngrok http -host-header=rewrite 3978
  1. Setup for code
  • Clone the repository

    git clone https://github.com/OfficeDev/Microsoft-Teams-Samples.git
  • Modify Update client_Id copied from step 1 in index.tsx file(samples/tab-graph-toolkit/csharp/TabGraphToolkit/clientapp/src)

    • In a terminal, navigate to samples/tab-graph-toolkit/csharp

      change into project folder

      cd # TabGraphToolkit
  • Install modules navigate to samples/tab-graph-toolkit/csharp/TabGraphToolkit/ClientApp

    npm install

    A) From a terminal

    # run the bot
    dotnet run

    B) Or from Visual Studio

    • Launch Visual Studio
    • File -> Open -> Project/Solution
    • Navigate to TabGraphToolkit folder
    • Select TabGraphToolkit.csproj file
    • Press F5 to run the project
  1. Setup Manifest for Teams
  • This step is specific to Teams.
    • Edit the manifest.json contained in the ./AppPackage folder to replace your Microsoft App Id (that was created when you registered your app registration earlier) everywhere you see the place holder string {{Microsoft-App-Id}} (depending on the scenario the Microsoft App Id may occur multiple times in the manifest.json)
    • Edit the manifest.json for validDomains and replace {{domain-name}} with base Url of your domain. E.g. if you are using ngrok it would be https://1234.ngrok.io then your domain-name will be 1234.ngrok.io.
    • Note: If you want to test your app across multi hub like: Outlook/Office.com, please update the manifest.json in the tab-graph-toolkit\csharp\TabGraphToolkit folder with the required values.
    • Zip up the contents of the appPackage folder to create a manifest.zip or Manifest_Hub folder into a manifest.zip.(Make sure that zip file does not contains any subfolder otherwise you will get error while uploading your .zip package)
  • Upload the manifest.zip to 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 ./AppPackage folder, select the zip folder, and choose Open.
    • Select Add in the pop-up dialog box. Your app is uploaded to Teams.

Running the sample

Once you access the Tab within your app you will be able to see following microsoft-graph-toolkit component.

  • <mgt-login>

Login

  • <mgt-agenda>

agenda

  • <mgt-people-picker>

people-picker

  • <mgt-tasks>

tasks

  • <mgt-todo>

todo

  • <mgt-person-card>

person-card

  • <mgt-person>

person

Outlook on the web

  • 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

InstallOutlook

Select your app icon to launch and preview your app running in Outlook on the web

AppOutlookLogin

AppOutlook

AppOutlookDetails

Note: Similarly, you can test your application in the Outlook desktop app as well.

Office on the web

  • 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

InstallOffice

Select your app icon to launch your app in Office on the web

AppOfficeLogin

AppOffice

AppOfficeDetails

Note: Similarly, you can test your application in the Office 365 desktop app as well.

Further Reading

Tab-graph-toolkit Extend Teams apps across Microsoft 365