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.
-
.NET Core SDK version 2.1
# determine dotnet version dotnet --version
-
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
- run ngrok - point to port 3978
- add the ngrok url to appsettings.json - SiteUrl
- create bot framework registration - using ngrok URL
- add MicrosoftAppId and MicrosoftAppPassword values to appsettings.json
- 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)
- add AAD ConnectionName to appsettings.json
- update your manifest.json to include the app id from bot framework
- zip up teams-manifest folder to create a manifest.zip
- upload manifest.zip to teams (from Apps view click "Upload a custom app")
- pick your bot from the compose command menu
To learn more about deploying a bot to Azure, see Deploy your bot to Azure for a complete list of deployment instructions.