Skip to content

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

AppCatalog sample

Bot Framework v4 AppCatalog sample.

This sample shows a AppCatalog bot and demonstrates teamsApp lifecycle in catalog followed by commands given to Bot.

Prerequisites

Prerequisites

  • Microsoft Teams is installed and you have an account
  • .NET Core SDK version 3.1
  • ngrok or equivalent tunnelling solution
  1. Clone the repository

    git clone https://github.com/OfficeDev/Microsoft-Teams-Samples.git

A) Or from Visual Studio code

  • Launch Visual Studio code
  • File -> Open Folder
  • Navigate to samples/graph-appcatalog-lifecycle/csharp folder
  • Select AppCatalogSample folder
  • Press F5 to run the project

B) Run ngrok - point to port 3978

```bash
ngrok http -host-header=rewrite 3978

Instruction on setting connection string for bot authentication on the behalf of user

  1. In the Azure portal, select your resource group from the dashboard.

  2. Select your bot channel registration link.

  3. Open the resource page and select Configuration under Settings.

  4. Select Add OAuth Connection Settings. image

  5. Complete the form as follows:

    a. Name. Enter a name for the connection. You'll use this name in your bot in the appsettings.json file. For example BotTeamsAuthADv1.

    b. Service Provider. Select Azure Active Directory. Once you select this, the Azure AD-specific fields will be displayed.

    c. Client id. Enter the Application (client) ID that you recorded for your Azure identity provider app in the steps above.

    d. Client secret. Enter the secret that you recorded for your Azure identity provider app in the steps above.

    e. Grant Type. Enter authorization_code.

    f. Login URL. Enter https://login.microsoftonline.com.

    g. Tenant ID, enter the Directory (tenant) ID that you recorded earlier for your Azure identity app or common depending on the supported account type selected when you created the identity provider app.

    h. For Resource URL, enter https://graph.microsoft.com/

    i. Add these Scopes"AppCatalog.Submit, AppCatalog.Read.All, AppCatalog.ReadWrite.Al" image

Concepts introduced in this sample

  • List apps in catalog

image

  • Publish app to catalog image
  • Update app in catalog
  • Delete app from catalog image

List apps in catalog

  • List all applications specific to the tenant : type "listapp" in chat and get all the app available in the same tenant. image
  • List applications with a given ID : type "app" in the chat and get deatils of app according to their appId. image
  • Find application based on the Teams app manifest ID : type "findapp" in the chat and get deatils of app according to their manifest Id.:
  • List applications with a given ID, and return the submission review state: type "status" in the chat and get deatils of app either published or not. image
  • List the details of only those apps in the catalog that contain a bot: type "bot" in the chat and get deatils of available bot in appcatalog. image

Publish app to catalog

  • type "publish" and upload the mainfest.zip of the teamsApp and app uploaded to appcatalog.

Update app to catalog

  • type "update" and upload the mainfest.zip of the teamsApp and app updated to appcatalog against of the app id.

Delete app to catalog app will be deleted from appcatalog against of the app id.

Further reading