Microsoft.Teams.Apps.BotBuilder 1.0.3

Prefix Reserved
dotnet add package Microsoft.Teams.Apps.BotBuilder --version 1.0.3
                    
NuGet\Install-Package Microsoft.Teams.Apps.BotBuilder -Version 1.0.3
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Microsoft.Teams.Apps.BotBuilder" Version="1.0.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Microsoft.Teams.Apps.BotBuilder" Version="1.0.3" />
                    
Directory.Packages.props
<PackageReference Include="Microsoft.Teams.Apps.BotBuilder" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Microsoft.Teams.Apps.BotBuilder --version 1.0.3
                    
#r "nuget: Microsoft.Teams.Apps.BotBuilder, 1.0.3"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Microsoft.Teams.Apps.BotBuilder@1.0.3
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Microsoft.Teams.Apps.BotBuilder&version=1.0.3
                    
Install as a Cake Addin
#tool nuget:?package=Microsoft.Teams.Apps.BotBuilder&version=1.0.3
                    
Install as a Cake Tool

Microsoft.Teams.Apps.BotBuilder

A compatibility bridge that enables existing Bot Framework SDK v4 applications to run on the modern Microsoft Teams Bot Core infrastructure. It implements the Adapter pattern, translating between Bot Framework interfaces and the new Teams Core SDK — allowing migration without rewriting existing bot logic.

Key Features

  • Drop-in AdapterTeamsBotFrameworkHttpAdapter implements IBotFrameworkHttpAdapter, so existing bots work with minimal changes
  • Full Conversation Support — Send, update, delete activities, manage members, and handle attachments through adapted interfaces
  • OAuth CompatibilityCompatUserTokenClient bridges token management between the two frameworks
  • Proactive MessagingContinueConversationAsync for resuming conversations from external triggers
  • Teams API Access — Static TeamsApiClient methods for Teams-specific operations (meetings, batch messaging, team/channel metadata)
  • Schema Translation — Bidirectional conversion between Bot Framework and Core activity models

Installation

dotnet add package Microsoft.Teams.Apps.BotBuilder

Quick Start

Register the Adapter

var builder = WebApplication.CreateBuilder(args);
builder.AddTeamsBotFrameworkHttpAdapter();

var app = builder.Build();
// Map your existing IBot implementation to the endpoint
app.MapPost("api/messages", async (HttpContext context) =>
{
    var adapter = context.RequestServices
        .GetRequiredService<IBotFrameworkHttpAdapter>();
    var bot = context.RequestServices.GetRequiredService<IBot>();
    await adapter.ProcessAsync(
        context.Request, context.Response, bot, context.RequestAborted);
});

app.Run();

Use with an Existing Bot

Your existing IBot implementation works unchanged:

public class MyBot : ActivityHandler
{
    protected override async Task OnMessageActivityAsync(
        ITurnContext<IMessageActivity> turnContext, CancellationToken ct)
    {
        await turnContext.SendActivityAsync(
            MessageFactory.Text($"Echo: {turnContext.Activity.Text}"), ct);
    }
}

// Register your bot
builder.Services.AddTransient<IBot, MyBot>();

Teams-Specific Operations

Use the static TeamsApiClient for Teams APIs within your bot handlers:

// Get a specific member
var member = await TeamsApiClient.GetMemberAsync(turnContext, userId);

// Get team details
var team = await TeamsApiClient.GetTeamDetailsAsync(turnContext);

// Get paginated team members
var members = await TeamsApiClient.GetPagedTeamMembersAsync(turnContext, teamId);

// Meeting info
var meeting = await TeamsApiClient.GetMeetingInfoAsync(turnContext);

// Send notification to a meeting
await TeamsApiClient.SendMeetingNotificationAsync(turnContext, notification);

Batch Messaging

// Send to all users in a team
var operationId = await TeamsApiClient.SendMessageToAllUsersInTeamAsync(
    turnContext, activity, teamId, tenantId);

// Send to all users in tenant
var operationId = await TeamsApiClient.SendMessageToAllUsersInTenantAsync(
    turnContext, activity, tenantId);

// Check operation status
var state = await TeamsApiClient.GetOperationStateAsync(turnContext, operationId);

// Get failed entries
var failures = await TeamsApiClient.GetPagedFailedEntriesAsync(turnContext, operationId);

Proactive Messaging

var adapter = serviceProvider
    .GetRequiredService<IBotFrameworkHttpAdapter>() as TeamsBotFrameworkHttpAdapter;

await adapter!.ContinueConversationAsync(
    botId, conversationReference,
    async (turnContext, ct) =>
    {
        await turnContext.SendActivityAsync("Proactive notification!", cancellationToken: ct);
    });

Architecture

The library bridges two frameworks through a set of adapter classes:

Bot Framework SDK                    Teams Bot Core
─────────────────                    ──────────────
IBotFrameworkHttpAdapter  ←──→  TeamsBotFrameworkHttpAdapter
BotAdapter                ←──→  TeamsBotAdapter
IConnectorClient          ←──→  CompatConnectorClient
IConversations            ←──→  CompatConversations  →  ConversationClient
UserTokenClient           ←──→  CompatUserTokenClient → Core UserTokenClient
Activity (BF)             ←──→  CoreActivity          (ActivitySchemaMapper)
  • TeamsBotFrameworkHttpAdapter handles HTTP request/response lifecycle and delegates to the Core SDK
  • CompatConversations implements IConversations by forwarding calls to the Core ConversationClient
  • CompatUserTokenClient adapts Core token operations to the Bot Framework UserTokenClient interface
  • ActivitySchemaMapper provides bidirectional conversion between Bot Framework Activity and Core CoreActivity
  • TeamsApiClient provides static methods for Teams-specific APIs not covered by standard Bot Framework interfaces

Main Types

Type Description
TeamsBotFrameworkHttpAdapter Primary adapter — implements IBotFrameworkHttpAdapter with full HTTP lifecycle
TeamsBotAdapter Base adapter bridging BotAdapter to Teams Core activity processing
TeamsApiClient Static utility for Teams-specific APIs (members, meetings, batch messaging, channels)
ActivitySchemaMapper Bidirectional conversion between Bot Framework and Core activity schemas
CompatHostingExtensions DI registration via AddTeamsBotFrameworkHttpAdapter()
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.3 53 5/28/2026
1.0.2 94 5/15/2026