Skip to content

Latest commit

 

History

History
 
 

52.teams-messaging-extensions-search-auth-config

EchoBot

Bot Framework v4 Teams Messaging Extensions Search with Auth and Config sample.

This bot has been created using Bot Framework, it shows how to create a simple bot that accepts search requests from the user and returns the results. The sample also incorporates auth and config via Messaging Extension.

Prerequisites

  • .NET Core SDK version 2.1

    # determine dotnet version
    dotnet --version

To try this sample

  • Clone the repository

    git clone https://github.com/Microsoft/botbuilder-samples.git
  • In a terminal, navigate to samples/csharp_dotnetcore/52.teams-messaging-extensions-search-auth-config

  • Run the bot from a terminal or from Visual Studio, choose option A or B.

    A) From a terminal

    # run the bot
    dotnet run

    B) Or from Visual Studio

    • Launch Visual Studio
    • File -> Open -> Project/Solution
    • Navigate to samples/csharp_dotnetcore/52.teams-messaging-extensions-search-auth-config folder
    • Select TeamsMessagingExtensionsSearchAuthConfig.csproj file
    • Press F5 to run the project

Testing the bot using Teams

  1. run ngrok - point to port 3978
  2. add the ngrok url to appsettings.json - SiteUrl
  3. create bot framework registration - using ngrok URL
  4. add MicrosoftAppId and MicrosoftAppPassword values to appsettings.json
  5. add an AAD V2 OAuth Connection Setting scopes: email Mail.Read User.Read openid profile User.ReadBasic.All Mail.Send.Shared (see https://docs.microsoft.com/en-us/azure/bot-service/bot-builder-authentication)
  6. add AAD ConnectionName to appsettings.json
  7. update your manifest.json to include the app id from bot framework
  8. zip up teams-manifest folder to create a manifest.zip
  9. upload manifest.zip to teams (from Apps view click "Upload a custom app")
  10. pick your bot from the compose command menu

Deploy the bot to Azure

To learn more about deploying a bot to Azure, see Deploy your bot to Azure for a complete list of deployment instructions.

Further reading