How a Microsoft Teams App and Bot Gets Set Up in the Enterprise
Every time someone types a message into a custom Teams bot, three separate things have to line up: the app package sitting in Teams, the bot backend handling that message, and the Entra identity authorising everything. Engineers tend to blur these together — which is fine when you're tinkering in your own tenant, but in an enterprise environment that blur turns into governance headaches, over-privileged service accounts, and support tickets at 2 a.m.
This post walks through how a Teams app and bot actually gets from a dev tenant to a governed, approved, scoped deployment — with identity as the through-line.
The Three Layers
1. The App Package
A Teams app package is essentially a manifest file (manifest.json) and some assets — icons, colour definitions, capability declarations. It contains no application code. Think of it as a contract between the app and Teams: here's what I need, here's how I appear in the sidebar, here are my tabs and messaging extensions.
The manifest declares things like:
- The app's display name, description, and version
- Which capabilities it uses (tabs, bots, messaging extensions, commands)
- The bot's Microsoft App ID — a GUID that links this package to the Azure Bot resource
- Icon sizes (19x19, 24x24, 32x32, 80x80, and 96x96) in both light and dark variants
- The bot's scope (personal, group chat, or team-wide)
The package is distributed as a .zip file. In development, you sideload it directly into your tenant. In production, it goes through the Teams admin center's approval pipeline.
2. The Bot Backend
The bot backend is where the actual logic lives — an Azure Bot resource paired with a hosted messaging endpoint (typically an Azure App Service or Azure Container Apps instance). When a user sends a message in Teams, the message hits Microsoft's messaging service, which forwards it to your endpoint over HTTPS.
The Azure Bot resource is essentially a routing layer. It gives you:
- A Microsoft App ID and tenant ID (for single-tenant bots)
- Channel registration (Teams, Web Chat, Slack, etc.)
- Direct line access for custom client scenarios
- Integration with Application Insights for telemetry
Your messaging endpoint receives the activity as JSON, processes it, and sends a reply back. The Bot Framework SDK (now folded into the Microsoft 365 Agents SDK) provides language-specific helpers for parsing activities, sending rich cards, and managing conversation state. But at its core, this is just an HTTPS endpoint talking JSON — you don't need the SDK if you prefer to roll your own handlers.
3. The Entra Identity
This is where things get interesting, and where most enterprise deployments either nail it or get it spectacularly wrong.
The bot needs an identity in Entra ID to do anything meaningful: call Microsoft Graph to read calendar events, post messages to channels on behalf of the user, or query SharePoint for document metadata. That identity comes in two flavours:
Single-tenant bots — The bot registers as a single-tenant app registration in your organisation's Entra tenant. This is the standard approach for enterprise bots that only serve your users.
Managed identity bots — If your backend runs on Azure (App Service, Container Apps, Functions), you attach an Entra managed identity to the Azure resource. The bot then authenticates to Graph using this managed identity, eliminating the need to store client secrets or certificates anywhere. This is the recommended approach for Azure-hosted backends.
Multi-tenant bot creation was retired in 2025. If you need a bot that works across organisations, you'll need to reconsider your architecture — either use webhook connectors or build a multi-app registration strategy.
SSO and Consent Models
For user-facing operations (reading the user's calendar, posting as the user), the bot uses delegated permissions with single sign-on. The first time a user interacts with the bot, they're prompted to consent to the delegated permissions the bot needs on their behalf. Subsequent interactions use the existing session.
For background or system operations (reading a shared mailbox, posting to a channel at a scheduled time), the bot uses application permissions. These don't require a user context — the bot acts as itself. In the Teams admin center, application permissions need explicit admin consent before they take effect.
Resource-specific consent (RSC) is the least-privilege option and deserves special mention. Rather than granting an app permission across your entire tenant, RSC scopes that permission to a specific resource — a particular team, channel, or file. A bot might have application permission to post messages only in the #engineering channel of the Engineering team, nowhere else. This is the granular approach that enterprise security teams prefer.
Governance in the Teams Admin Center
Once you've got the technical pieces working, governance is where the rubber meets the road. The Teams admin center provides several levers:
Sideloading policy — Controls whether users can install apps from .zip files or external sources. In most enterprises, this is set to off for general users and on only for a designated group of testers or IT staff.
Org catalog approval — Apps submitted to the org catalog go through an approval workflow. Admins review the app's manifest, permissions, and capabilities before it becomes visible to users. This is your gate for production apps.
App-centric management — Once approved, admins can manage the app at scale: set who can use it (specific users, groups, or the whole org), configure per-app settings, and monitor usage metrics.
Setup policies — These control what users see in their Teams client. You can hide the bot from certain user groups, pin it to specific teams, or restrict it to team-wide scope only (no personal or group chat use). Setup policies are how you enforce the principle of least exposure.
The End-to-End Rollout Flow
A typical enterprise rollout looks like this:
- Development — Developer builds the bot backend and manifest in a dev tenant. The app is sideloaded for testing. Identity is configured as a single-tenant app registration or managed identity.
- Staging / UAT — The
.zippackage is submitted to the org catalog in a staging environment. QA testers validate functionality, permissions, and user experience. Security review covers the app's permission scope and data handling. - Admin consent — App permissions are submitted for admin consent in Entra ID. Delegated permissions may also need admin pre-approval depending on organisational policy. RSC scopes are configured for any channel- or team-specific access.
- Production approval — The app is reviewed and approved in the Teams admin center. Admins configure which groups or users can access it via app-centric management settings.
- Deployment — The approved app appears in the org catalog for authorised users. Setup policies control where and how the bot appears. Usage monitoring is enabled via Application Insights and the Teams admin center analytics.
- Ongoing management — Updates to the manifest or backend are handled through a new version of the
.zippackage, which goes through the same approval pipeline. Permission changes require re-consent.
When a Webhook Is Enough
Not every automation needs a full bot. If your requirement is simply to push notifications into a channel — deployment alerts, monitoring events, CI/CD pipeline status — an incoming webhook connector does the job without any of the identity overhead.
Webhooks are:
- Zero identity setup — No app registration, no permissions, no consent flows
- Simple — A single URL that accepts POST requests with a JSON payload
- Channel-scoped — Each webhook is tied to one channel; you create separate webhooks for different channels
- One-way — They push messages in. They can't receive or respond to user input
The trade-off is simplicity versus capability. If you need two-way interaction, personal messaging, or Graph API access, you need a bot. If you just need to get information into a channel, a webhook is lighter, faster to set up, and easier to govern.
Tooling Changes You Should Know
Microsoft has been consolidating its bot and agents tooling, and the naming has shifted:
- The Bot Framework SDK (the language-specific SDKs for building bots) has been replaced by the Microsoft 365 Agents SDK. The underlying protocols are the same, but the package names, namespaces, and tooling references have changed.
- The Teams Toolkit (the VS Code extension and CLI for building Teams apps) has been rebranded as part of the Microsoft 365 developer experience. If you're following older tutorials, the tool names won't match what you see in current documentation.
These are renames more than redesigns — the core concepts (manifest, endpoint, identity) haven't changed. But if you're setting up a new project today, make sure you're following the latest guidance and using the updated package names.
Wrapping Up
The pattern is straightforward once you separate the layers:
- The app package tells Teams what the bot does
- The bot backend handles the actual conversation logic
- The Entra identity controls what the bot can access
- Governance in the Teams admin center controls who gets to see and use it
The most common mistake is treating the identity layer as an afterthought — spinning up a multi-tenant app registration, granting broad application permissions, and hoping for the best. In an enterprise environment, that approach comes back to haunt you during a security audit or an incident response.
Start with managed identities where possible, scope your Graph permissions tightly (RSC where it makes sense), and let the Teams admin center do its job on governance. The rest is just code.
Feature image: Michel Bakni / CC BY-SA 4.0 / Wikimedia Commons.