Skip to main content

Essentials

At its core, an application that hosts an agent on Microsoft Teams exists to do three things well: listen to activities, handle the ones that matter, and respond efficiently. Whether a user sends a message, opens a dialog, or clicks a button — your app is there to interpret the activity and act on it.

With Teams SDK, we've made it easier than ever to build this kind of reactive, conversational logic. The SDK gives you simple, strongly-typed handlers to connect to Teams, react to activities, and build intelligent agent behaviors quickly.

Before diving in, let's define a few key terms:

  • Activity: The Teams-specific payload that flows between the user and your app. Activities include things like messages, reactions, adaptive card actions, and installs.
  • InvokeActivity: A specific kind of activity triggered by user interaction (like submitting a form), which may or may not require a response.
  • Handler: The logic in your application that reacts to an activity. You register handlers (OnMessage, OnMessageReaction, OnEvent, …) that decide what to do, when, and how to respond.

In the 2.1, your app is a standard ASP.NET Core application. Incoming activities from Teams arrive at your app's endpoint, pass through any turn middleware you register, and are routed to the dedicated activity handler (OnMessage, OnEvent, OnMembersAdded, …) that matches.

SDK 2.0 (Legacy)

SDK 2.0 routed both incoming and outgoing events through a plugin event bus before they reached your handlers. The 2.1 removes plugins in favor of standard ASP.NET Core middleware and dependency injection.

This section will walk you through the foundational pieces needed to build responsive, intelligent agents using the SDK.