![]() |
VOOZH | about |
dotnet add package Microsoft.Teams.Apps.BotBuilder --version 1.0.4
NuGet\Install-Package Microsoft.Teams.Apps.BotBuilder -Version 1.0.4
<PackageReference Include="Microsoft.Teams.Apps.BotBuilder" Version="1.0.4" />
<PackageVersion Include="Microsoft.Teams.Apps.BotBuilder" Version="1.0.4" />Directory.Packages.props
<PackageReference Include="Microsoft.Teams.Apps.BotBuilder" />Project file
paket add Microsoft.Teams.Apps.BotBuilder --version 1.0.4
#r "nuget: Microsoft.Teams.Apps.BotBuilder, 1.0.4"
#:package Microsoft.Teams.Apps.BotBuilder@1.0.4
#addin nuget:?package=Microsoft.Teams.Apps.BotBuilder&version=1.0.4Install as a Cake Addin
#tool nuget:?package=Microsoft.Teams.Apps.BotBuilder&version=1.0.4Install as a Cake Tool
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.
TeamsBotFrameworkHttpAdapter implements IBotFrameworkHttpAdapter, so existing bots work with minimal changesCompatUserTokenClient bridges token management between the two frameworksContinueConversationAsync for resuming conversations from external triggersTeamsApiClient methods for Teams-specific operations (meetings, batch messaging, team/channel metadata)dotnet add package Microsoft.Teams.Apps.BotBuilder
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();
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>();
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);
// 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);
var adapter = serviceProvider
.GetRequiredService<IBotFrameworkHttpAdapter>() as TeamsBotFrameworkHttpAdapter;
await adapter!.ContinueConversationAsync(
botId, conversationReference,
async (turnContext, ct) =>
{
await turnContext.SendActivityAsync("Proactive notification!", cancellationToken: ct);
});
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 SDKCompatConversations implements IConversations by forwarding calls to the Core ConversationClientCompatUserTokenClient adapts Core token operations to the Bot Framework UserTokenClient interfaceActivitySchemaMapper provides bidirectional conversion between Bot Framework Activity and Core CoreActivityTeamsApiClient provides static methods for Teams-specific APIs not covered by standard Bot Framework interfaces| 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 | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 is compatible. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
This package is not used by any NuGet packages.
This package is not used by any popular GitHub repositories.