Microsoft Teams AI Agent: 8 Parts for Channel Chat

Table of Contents

A Microsoft Teams AI agent is a conversational agent registered as a bot in a Microsoft 365 tenant, reachable by mention in channels or by direct message, whose logic runs on an external HTTPS service rather than inside Teams. Teams delivers the message and renders the reply; the model, the tools and the hosting sit outside it.

1. Azure Bot resource: The registration Teams checks

Azure Bot resource quickstart in Microsoft Learn documentation

Teams will not talk to an arbitrary web service. An agent becomes addressable only once it has an Azure Bot resource, which Microsoft describes as the way you register a bot with Azure AI Bot Service and connect it to channels. Creating that resource produces the identity Teams uses to recognise your agent, and it is where you enable the Teams channel itself.

Two things are configured here and both are easy to get wrong. The first is the messaging endpoint: the HTTPS URL that Bot Service will post every incoming activity to. The second is the app identity, a Microsoft Entra app registration with a client ID and secret, or a managed identity, which your service uses to prove that outbound replies really come from the registered bot.

This is the structural difference between Teams and the chat platforms developers usually meet first. A Slack app can hold a WebSocket open and never expose a public URL at all, which is why connecting an AI agent to Slack can be done from a laptop behind a router. Teams has no equivalent. Bot Service calls you, so something of yours must be publicly reachable and listening whenever a user types.

Plan the identity before the code. The client secret you create here is a long-lived credential that can post as your organisation’s agent, so it belongs in a secret store alongside your other agent credentials, not in a config file next to the source.

2. Microsoft 365 Agents SDK: The plumbing layer

Microsoft 365 Agents SDK documentation landing page

Between the HTTPS endpoint and your agent’s logic sits a layer that has to understand Microsoft’s activity format, validate the inbound token, track conversation references and send replies back on the right thread. The Microsoft 365 Agents SDK exists for exactly that. Microsoft’s own description calls it the plumbing layer between a user sending a message and whatever logic you built to respond.

Its two design choices matter for anyone bringing an existing agent. It provides a channel abstraction, so logic written once can serve Teams, Copilot, a website or non-Microsoft surfaces without separate integration code for each. And it is AI-agnostic by design: the documentation is explicit that it provides scaffolding for receiving messages, managing state and routing events while making no assumptions about what generates the response.

That second point is the one that decides your architecture. The SDK does not want to own your model or your orchestration. You can hand each incoming message to any agent framework you already run and post the result back. The SDK supports C# on .NET 8, JavaScript on Node.js 18 and later, and Python 3.9 to 3.11.

If your agent already runs somewhere else entirely, the thinnest viable version of this component is a small service in one of those languages that receives the activity, forwards it to your agent, and returns the reply. Everything Teams-specific stays in that service.

3. App package and manifest: How Teams finds the agent

Teams app package documentation showing manifest and icon requirements

Users do not type a URL to reach an agent in Teams. They install an app, and that app is a zip file. Microsoft’s packaging documentation lists what it must contain: an app manifest describing how the app is configured, plus app icons, where each package requires a colour and an outline icon.

One line in that documentation is worth reading twice, because it defines the whole deployment model: Teams doesn’t host your app. What a user installs is only a configuration file and your icons. The logic and data storage live elsewhere, and Teams reaches them over HTTPS. Nothing you write is uploaded to Microsoft.

The manifest is where you declare the shape of the agent: whether it is a personal chat bot, a channel and group chat bot, or both, and which commands appear to users. You can author it with the Microsoft 365 Agents toolkit in Visual Studio Code or Visual Studio, which generates the manifest from a template and zips the package, or in the web-based Developer Portal for Teams.

Distribution then depends on your tenant’s rules. An admin can upload the package for the organisation, or publish it through the admin centre, and in many enterprises sideloading custom apps is disabled by policy. Confirm who can approve that before you build, because an agent nobody is allowed to install is an expensive prototype.

4. SetupYourClaw: The always-on endpoint behind it

SetupYourClaw managed OpenClaw deployment homepage

Because Teams hosts the manifest and not the agent, the project quietly becomes a hosting project. An agent people mention in a channel has to be running at any hour, behind a valid certificate, and still alive after a kernel upgrade. SetupYourClaw is a managed deployment of OpenClaw aimed at that half of the work: the agent process provisioned, connected and kept running without you administering the server it sits on. The Teams activity handling from the sections above is still yours to write and point at it.

The division of labour is clean. The Teams-facing pieces above — registration, manifest, activity handling — are configuration you own once and rarely touch. The runtime underneath is the part that fails at three in the morning. A managed deployment moves that second half off your plate while leaving the agent’s behaviour, model choice and connected tools yours to define.

It fits best when the agent is the point and the infrastructure is not: an internal assistant answering from your own systems, or an agency standing the same pattern up for several clients. It fits badly if compliance requires the agent inside a specific Azure subscription, or if your security review requires the process to sit in a network you control. There, self-hosting the runtime is the honest answer.

The test to apply is the week-three test, not the day-one test. Standing up any endpoint is easy. Owning restarts, renewals and upgrades for the next year is the actual commitment.

5. Agent runtime: What actually writes the reply

Claude Agent SDK overview documentation page

Nothing so far generates a single word of text. The runtime is the component that takes a question from a Teams thread, decides what to do, calls tools if it needs them, and returns an answer. Because the Agents SDK is deliberately AI-agnostic, this slot is genuinely open.

The Claude Agent SDK is one option, documented as a way to build production agents with Claude Code as a library. It is built around an agent loop rather than a single completion, which matters for the questions people actually ask an agent in a work chat: a request like “summarise where the Henderson account stands” is several lookups and a judgement, not one prompt.

OpenClaw is the other shape worth knowing, a general-purpose self-hosted agent rather than a library you embed. Choosing between them is mostly about whether you want to write the orchestration or run a system that already has it, and the trade-off is the same one covered in OpenClaw versus Claude Code.

Two Teams-specific constraints shape whichever you pick. Replies that take longer than a few seconds need a typing indicator or an immediate acknowledgement, or users assume the agent is broken. And conversation state has to be keyed to the Teams thread, so a follow-up question in the same thread reaches an agent that remembers the previous turn.

6. MCP servers: The systems the agent reads

Model Context Protocol documentation homepage

An agent in Teams that only knows what the model remembers is a novelty. The useful version reads your tenant’s data and your business systems, and the Model Context Protocol is the standard way to connect it. MCP is documented as an open-source standard for connecting AI applications to external systems, which is precisely the gap between a chat reply and a useful answer.

For Microsoft data itself, Microsoft Graph is the route. Microsoft describes it as the gateway to data and intelligence in Microsoft cloud services like Microsoft Entra and Microsoft 365, and it is what an agent calls to read a calendar, find a file or look up who reports to whom. Graph permissions are the scope decision that matters most here, because they are granted to the app, not to the person asking.

Beyond the tenant, the same pattern connects whatever the team runs on: a CRM, a project tracker, a ticketing system. Each one becomes a set of tools the runtime can call. Keep the read and write surfaces separate while you are still learning what people ask for, and give the agent the narrowest scope that answers the question.

Scoping deserves one specific warning. A Teams agent lives in a tenant where different people see different things, and an agent holding broad application permissions will happily answer a question the asker had no right to ask. Decide early whether tools act as the app or as the signed-in user.

7. Adaptive Cards: Approvals inside the thread

Teams card types reference documentation including Adaptive Cards

Plain text is a poor interface for anything consequential. Teams bots can reply with cards instead, and Microsoft’s reference lists adaptive, hero, list, receipt, sign-in and thumbnail cards among the types supported in bots, noting that they are based on Bot Framework cards and that Teams does not support all of them.

Adaptive Cards are the ones that change what the agent can be trusted to do. A card can carry structured fields and buttons, so instead of announcing an action the agent can propose it and wait: here is the draft reply, here is the record I plan to update, approve or edit. The thread becomes the review queue, and the person who approves is visible in the channel afterwards.

That pattern is what makes write access defensible. An agent that can post messages and change records needs a gate on the actions that matter, and a card in the thread is the cheapest gate that people will actually use, the same principle described in AI agent approval gates. Reads can flow freely; writes stop for a human.

Keep the cards boring. One clear statement of what will happen, the two or three fields a reviewer needs to judge it, and buttons with unambiguous labels. A card that requires reading the whole thread to understand gets approved without being read, which is worse than no gate at all.

8. Monitoring and audit: What happened last night

Azure Monitor Application Insights observability overview documentation

An agent in a channel fails in public. When the endpoint is down, Teams shows users an error, and the first you hear of it is someone asking whether the bot is broken. Application Insights is the standard answer on this stack, described by Microsoft as an application performance monitoring feature of Azure Monitor, with OpenTelemetry as the vendor-neutral way to instrument the service.

Three signals are worth having from the first week. Endpoint health, because a Teams agent that cannot answer within seconds is indistinguishable from one that is offline. Per-conversation traces, so a complaint about a wrong answer can be traced to the tools the agent actually called. And authentication failures, which is how an expired client secret announces itself.

Keep a log of tool calls separately from the model’s text. When someone asks why the agent updated a record, the useful record is the sequence of calls and their arguments, not the transcript. That record is what answers the question, and it applies whether the runtime is yours or managed.

During development, Microsoft’s dev tunnels give the public HTTPS URL that Bot Service needs to reach a service on your machine. The documentation is clear that it is for ad hoc testing and development, so treat it as a debugging tool and never as the messaging endpoint of a production agent.

Microsoft Teams AI agent parts at a glance

Part Role Who runs it Skip it if
Azure Bot resource Registration and Teams channel Microsoft Azure Never, Teams requires it
Microsoft 365 Agents SDK Activity handling and channel abstraction Your service You handle the protocol yourself
App package and manifest How users install and mention the agent You, then a tenant admin Never, it is the install unit
SetupYourClaw Managed always-on agent runtime Managed for you Compliance requires your own subscription
Agent runtime Decides and writes the reply You or a managed host Never, this is the agent
MCP servers and Graph Reads tenant and business data You The agent answers from the model alone
Adaptive Cards Structured replies and approvals Your service The agent is strictly read-only
Monitoring and audit Health, traces and tool logs You or a managed host Never, it fails in public

How to approach the build

Build in the order the platform forces, not the order that is most interesting. Register the Azure Bot resource and get a trivial echo reply working in a real Teams client first, because that proves the identity, the endpoint and the manifest at once, and almost every integration failure lives in those three. Only then swap the echo for your agent. Settle the hosting question before writing agent logic, since whether you administer that server changes what you can promise about uptime and is the hardest part to retrofit. Add tools one at a time, read-only first, and put a card-based approval in front of the first write.

Frequently asked questions

Do I need Copilot Studio to put an AI agent in Teams?

No. Copilot Studio is one route, but Microsoft also ships the Microsoft 365 Agents SDK for agents that bring their own orchestration, and its documentation states the SDK is AI-agnostic by design. If you already run an agent and want it reachable in Teams, the SDK path lets you keep that runtime and add a Teams surface in front of it.

Does a Microsoft Teams AI agent need a public HTTPS endpoint?

Yes. Teams installs only a manifest and icons, and Microsoft’s packaging documentation says plainly that Teams does not host your app and reaches your logic over HTTPS. Azure AI Bot Service posts each incoming activity to a messaging endpoint you provide, so a service of yours has to be publicly reachable whenever users expect a reply.

How is a Teams agent different from a Slack agent?

Mainly in who initiates the connection. A Slack app can hold a socket open from behind a firewall, so no inbound URL is needed. Teams works the other way: Bot Service calls your endpoint, which adds a registration, a certificate and an uptime requirement. The agent logic can be identical across both surfaces.

Can the agent read files and calendars in my tenant?

Through Microsoft Graph, which Microsoft describes as the gateway to data in Microsoft cloud services like Entra and Microsoft 365. The important decision is scope. Permissions are granted to the app, so an agent with broad application access can answer questions the person asking was never entitled to ask. Grant the narrowest scope that works.

Who has to approve the app before my team can use it?

A Microsoft 365 or Teams administrator, and in many tenants uploading custom apps is restricted by policy. Distribution is either an admin uploading the package for the organisation or publishing it through the admin centre. Confirm that permission exists before building, because it is the most common reason a finished agent sits unused.

Conclusion

Most of the work in a Microsoft Teams AI agent is not the agent. It is a registration, a manifest, a permission an admin has to grant, and a service that answers HTTPS requests at any hour because Teams hosts none of your logic. The configuration is a one-time cost. The running endpoint is a standing commitment, and it is the part that breaks first. If you want the agent working and connected without owning that server, SetupYourClaw provisions and maintains the runtime for you, leaving the behaviour, the model and the connected tools yours to decide.