-
Notifications
You must be signed in to change notification settings - Fork 909
Root files for bot-quickstart sample #1888
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
AjayJ12-MSFT
wants to merge
15
commits into
main
Choose a base branch
from
v-ajayjadhav/BotConversationReadmeGitignoreandAppManifest
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+178
−31
Open
Changes from 3 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
9e56312
Adding app manifest, gitignore, README
AjayJ12-MSFT d943432
Update bot-conversation.gif
AjayJ12-MSFT 57f0046
Update manifest.json
AjayJ12-MSFT d126ba0
Update README.md
AjayJ12-MSFT ff687c6
Updating sample name
AjayJ12-MSFT 0b2125b
Fixing PR comments
AjayJ12-MSFT f71c135
Adding separate directory for bot-quickstart
AjayJ12-MSFT 83e9b50
adding missing files
AjayJ12-MSFT 58cd14c
Add files via upload
AjayJ12-MSFT 20dc6e8
Delete .gitignore
AjayJ12-MSFT be6c327
Merge branch 'v-ajayjadhav/BotConversationReadmeGitignoreandAppManife…
AjayJ12-MSFT 88da322
Added back gitignore and updated Readme
AjayJ12-MSFT e446ba6
Update README.md
AjayJ12-MSFT d6432c8
Fixing PR comments
AjayJ12-MSFT 4df196e
Update bot-quickstart.gif
AjayJ12-MSFT File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| launchSettings.json | ||
| appsettings.*.json | ||
| package-lock.json | ||
| .env | ||
| uv.lock | ||
| .venv/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,147 @@ | ||
| # Teams Conversation Bot | ||
|
|
||
| This sample demonstrates how to handle various bot conversation events in Microsoft Teams, including adaptive cards, read receipts, message update/delete events, and mentions. It showcases capabilities such as immersive reader support, AI labels, citations, feedback buttons, and sensitivity labels. | ||
|
|
||
| ## Interaction with Bot | ||
|
|
||
|  | ||
|
|
||
| The bot responds to the following commands: | ||
|
|
||
| * **Who am I?** - Gets information about the current user | ||
| * **Find me in Adaptive Card** - Mentions the user in an Adaptive Card | ||
lilyydu marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| * **Update Card** - Updates the card message with a counter | ||
| * **Delete card** - Deletes the card message | ||
| * **Send Immersive Reader Card** - Shows an Immersive Reader card with flight status | ||
|
|
||
| ## Sample Implementations | ||
|
|
||
| | Language | Framework | Directory | | ||
| |----------|-----------|-----------| | ||
| | C# | .NET 10 / ASP.NET Core | [dotnet/bot-conversation](dotnet/bot-conversation/README.md) | | ||
| | TypeScript | Node.js | [nodejs/bot-conversation](nodejs/bot-conversation/README.md) | | ||
| | Python | Python 3.12+ | [python/bot-conversation](python/bot-conversation/README.md) | | ||
|
|
||
| # How to run these samples | ||
|
|
||
| You can run these samples locally using the `agentsplayground` tool, without provisioning the Teams App, or you can run in the Teams Client after you have provisioned the Teams Application and configured the application with your local DevTunnels URL. | ||
lilyydu marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ## Run in the `agentsplayground` | ||
|
|
||
| Install the tool agentsplayground for your platform | ||
|
|
||
| Windows | ||
|
|
||
| ``` | ||
| winget install agentsplayground | ||
| ``` | ||
|
|
||
| Linux | ||
|
|
||
| ``` | ||
| curl -s https://raw.githubusercontent.com/OfficeDev/microsoft-365-agents-toolkit/dev/.github/scripts/install-agentsplayground-linux.sh | bash | ||
| ``` | ||
|
|
||
| Other platforms (like MacOS, via npm) | ||
|
|
||
| ``` | ||
| npm install -g @microsoft/m365agentsplayground | ||
| ``` | ||
|
|
||
| Once the tool is installed, you can run it from your terminal with the command `agentsplayground`, and it will try to connect to `localhost:3978` where your bot is running. | ||
|
|
||
| ## Run in the Teams Client | ||
|
|
||
| To run these samples in the Teams Client, you need to provision your app in a M365 Tenant, and configure the app to your DevTunnels URL. | ||
|
|
||
| 1. Install the tool DevTunnels https://learn.microsoft.com/en-us/azure/developer/dev-tunnels/get-started | ||
| 2. Get Access to a M365 Developer Tenant https://learn.microsoft.com/en-us/office/developer-program/microsoft-365-developer-program-get-started | ||
| 3. Create a Teams App with the Bot Feature in the Teams Developer Portal (in your tenant) https://dev.teams.microsoft.com | ||
|
|
||
| ### Configure DevTunnels | ||
|
|
||
| Create a persistent tunnel for the port 3978 with anonymous access | ||
|
|
||
| ``` | ||
| devtunnel create -a my-tunnel | ||
| devtunnel port create -p 3978 my-tunnel | ||
| devtunnel host my-tunnel | ||
| ``` | ||
|
|
||
| Take note of the URL shown after *Connect via browser:* | ||
|
|
||
| ### Provisioning the Teams Application | ||
|
|
||
| Navigate to the Teams Developer Portal http://dev.teams.microsoft.com | ||
|
|
||
| #### Create a new Bot resource | ||
|
|
||
| 1. Navigate to `Tools->Bot management`, and add a `New bot` | ||
| 1. In Configure, paste the Endpoint address from devtunnels and append `/api/messages` | ||
| 1. In Client secrets, create a new secret and save it for later | ||
|
|
||
| > Note. If you have access to an Azure Subscription in the same Tenant, you can also create the Azure Bot resource ([learn more](https://learn.microsoft.com/en-us/azure/bot-service/abs-quickstart?view=azure-bot-service-4.0&tabs=singletenant)). | ||
|
|
||
| #### Create a new Teams App | ||
|
|
||
| 1. Navigate to `Apps` and create a `New App` | ||
| 1. Fill the required values in Basic information (short and long name, short and long description and App URLs) | ||
| 1. In `App features->Bot` select the bot you created previously | ||
| 1. Select `Preview in Teams` | ||
|
|
||
| > Note. When using an Azure Bot resource, provide the ClientID instead of selecting an existing bot. | ||
|
|
||
| ## Configure the new project to use the new Teams Bot Application | ||
|
|
||
| For NodeJS and Python you will need a `.env` file with the next fields | ||
|
|
||
| ``` | ||
| TENANT_ID= | ||
| CLIENT_ID= | ||
| CLIENT_SECRET= | ||
| ``` | ||
|
|
||
| For dotnet you need to add these values to `appsettings.json` or `launchSettings.json` using the next syntax. | ||
|
|
||
| appSettings.json | ||
|
|
||
|
|
||
| ```json | ||
| "urls" : "http://localhost:3978", | ||
| "Teams": { | ||
| "ClientID": "", | ||
| "ClientSecret": "", | ||
| "TenantId": "" | ||
| }, | ||
| ``` | ||
|
|
||
| Or to use Env Vars from the profile defined in `launchSettings.json` (using the Environment Configuration Provider) | ||
|
|
||
| ```json | ||
| "teamsbot": { | ||
| "commandName": "Project", | ||
| "dotnetRunMessages": true, | ||
| "launchBrowser": false, | ||
| "applicationUrl": "http://localhost:3978", | ||
| "environmentVariables": { | ||
| "ASPNETCORE_ENVIRONMENT": "Development", | ||
| "Teams__TenantId": "YOUR_TenantId", | ||
| "Teams__ClientID": "YOUR_ClientId", | ||
| "Teams__ClientSecret": "YOUR_ClientSecret" | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| ## Pro Tip: Read the configuration settings using the Azure CLI | ||
|
|
||
| To obtain the TenantId, ClientId and SecretId you can use the Azure CLI with: | ||
|
|
||
| > Note. If you don't have access to an Azure Subscription you can still use the Azure CLI, make sure you login with `az login --allow-no-subscription` | ||
|
|
||
| ``` | ||
| az ad app credential reset --id $appId | ||
| ``` | ||
|
|
||
| ## Further Reading | ||
|
|
||
| - [Microsoft Teams SDK Documentation](https://learn.microsoft.com/microsoftteams/platform/) | ||
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| { | ||
| "$schema": "https://developer.microsoft.com/json-schemas/teams/v1.19/MicrosoftTeams.schema.json", | ||
| "manifestVersion": "1.19", | ||
| "version": "1.0.0", | ||
| "id": "${{TEAMS_APP_ID}}", | ||
| "developer": { | ||
| "name": "teamsConversationBot", | ||
| "websiteUrl": "https://www.microsoft.com", | ||
| "privacyUrl": "https://www.teams.com/privacy", | ||
| "termsOfUseUrl": "https://www.teams.com/termsofuser" | ||
| }, | ||
| "icons": { | ||
| "outline": "outline.png", | ||
| "color": "color.png" | ||
| }, | ||
| "name": { | ||
| "short": "TeamsConversationBot", | ||
| "full": "TeamsConversationBot" | ||
| }, | ||
| "description": { | ||
| "short": "Demo bot for Teams showing conversation events with adaptive card support.", | ||
| "full": "This sample app showcases Teams bot conversation events and adaptive cards." | ||
| }, | ||
| "accentColor": "#FFFFFF", | ||
| "bots": [ | ||
| { | ||
| "botId": "${{CLIENT_ID}}", | ||
| "scopes": [ | ||
| "personal", | ||
| "groupChat", | ||
| "team" | ||
| ], | ||
| "isNotificationOnly": false, | ||
| "supportsCalling": false, | ||
| "supportsVideo": false, | ||
| "supportsFiles": false, | ||
| "commandLists": [ | ||
| { | ||
| "scopes": [ | ||
| "personal", | ||
| "groupChat", | ||
| "team" | ||
| ], | ||
| "commands": [ | ||
| { | ||
| "title": "Mentionme", | ||
| "description": "Sends message with @mention of the sender" | ||
| }, | ||
| { | ||
| "title": "Whoami", | ||
| "description": "Sends message with name of the sender" | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| } | ||
| ], | ||
| "permissions": [ | ||
| "identity", | ||
| "messageTeamMembers" | ||
| ], | ||
| "validDomains": ["${{BOT_DOMAIN}}"] | ||
| } |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.