Skip to content

Update bot-message-extension sample with teams sdk 2.1 - #2391

Open
AjayJ12-MSFT wants to merge 5 commits into
mainfrom
v-ajayjadhav/messageextensionteamssdk2.1update
Open

Update bot-message-extension sample with teams sdk 2.1#2391
AjayJ12-MSFT wants to merge 5 commits into
mainfrom
v-ajayjadhav/messageextensionteamssdk2.1update

Conversation

@AjayJ12-MSFT

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the TeamsSDK bot-message-extension (.NET) sample to use the Microsoft Teams SDK 2.1 surface area, including new message extension APIs and Azure AD configuration keys.

Changes:

  • Migrates the bot wiring from the older Teams ASP.NET Core plugin to Microsoft.Teams.Apps / Microsoft.Teams.Cards APIs.
  • Updates configuration from Teams:* settings to AzureAd:* (including client credential array format).
  • Adjusts local launch settings to reflect the new AzureAd environment variable names.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
samples/TeamsSDK/bot-message-extensions/dotnet/bot-message-extensions/Program.cs Refactors message extension handlers and attachment/response creation to the Teams SDK 2.1 API surface.
samples/TeamsSDK/bot-message-extensions/dotnet/bot-message-extensions/BotMessageExtensions.csproj Replaces old package dependency with Teams SDK 2.1 packages.
samples/TeamsSDK/bot-message-extensions/dotnet/bot-message-extensions/appsettings.json Renames/configures auth settings under AzureAd with client credential array.
samples/TeamsSDK/bot-message-extensions/dotnet/bot-message-extensions/Properties/launchSettings.EXAMPLE.json Updates env var names and adds a flag that bypasses auth for local runs.
Suppressed comments (1)

samples/TeamsSDK/bot-message-extensions/dotnet/bot-message-extensions/Program.cs:138

  • CreateSearchResultAttachment builds a ThumbnailCard payload with only title/text, so users can't open the Wikipedia article from the result. Add an OpenUrl button (and accept the URL as an argument) so selecting a result stays useful.
static TeamsAttachment CreateSearchResultAttachment(string title, string text)
{
    return TeamsAttachment.CreateBuilder()
        .WithContent(new { title, text })
        .WithContentType(AttachmentContentTypes.ThumbnailCard)

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@Harikrishnan-MSFT Harikrishnan-MSFT left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved!!

@AjayJ12-MSFT

Copy link
Copy Markdown
Contributor Author
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

4 participants