This is a sample of a bot, developed using the Bot Framework C# SDK v4, that provides the VSTS access to users who are conversating on MS Teams. The authentication is managed as in the official OAuth Web Sample sample and an Azure Cosmos DB is used to keep the relation between a specific user and his VSTS authorization token.
VSTS query calls are not yet implemented and they are leaved to other customizations.
-
Deploy the sample solution on an Azure Web App, you need the web app endpoint for the next step
-
Create an Azure Bot Channels Registration to register the bot and retrive App Id and App Password and to enable the conversation on Teams
-
Register an app in your VSTS account in order to retrieve
- ClientSecret
- AppId
in the AuthenticationHeper.cs you need also other VSTS settings that you can find in the appsetting.json file:
- AuthURL: "https://app.vssps.visualstudio.com/oauth2/authorize"
- CallbackUrl: "https://testvstsbotv1.azurewebsites.net/api/VSTSAuth"
- TokenUrl: "https://app.vssps.visualstudio.com/oauth2/token"
- Scope: "vso.graph vso.work_full" - you can add other scopes as you need
-
Create an Azure Cosmos DB account with SQL API, you need to add to the appsettings endpoint and key - in the code 2 DBs are used:
- VSTSDb for user tokens with a collection VSTSToken
- BotData for the conversation history with a collection called BotCollection
you can easily change this names, if you want/need
-
Add a Teams App in Teams that you can configure creating an App Package and upload it in Teams - see App Studio to create and export the Manifest directly in Teams
- Configure LUIS for Natural Language Processing, in particular to execute VSTS query on workitems
- Configure other features (if not "vsts")
- ...