OpenClaw Microsoft Teams configuration
The auth environment variables, history and thread context limits, context visibility modes, cloud and service URL for government and China clouds, the webhook, DM policies and stable object IDs, chunk and media limits, per-team and per-channel overrides, welcome cards, feedback, and SSO
The Teams channel has one of the longest key lists of any OpenClaw channel, because it has to cover government clouds, Graph-backed history, per-team overrides and Adaptive Card welcome flows in one block. Here is the list the way the docs group it: environment variables, history context, and the configuration keys themselves.
Environment variables and history
- Only the auth-related keys can come from the environment: the app ID, the app password, the tenant ID, the auth type as secret or federated, the certificate path and thumbprint for the certificate method, and the managed-identity flag and client ID for the identity method; other keys such as the group policy or the history limit are config-only.
- The history limit controls how many recent channel or group messages are wrapped into the prompt, falling back to the global group-chat history limit and then to 50, with zero disabling it.
- Graph thread context adds the parent and up to the oldest 50 replies alongside recent channel history, excludes the triggering message, keeps history separate from the sender's command text so commands quoted in history do not execute, and trims long fetched messages to their beginning and end within the per-message limit.
- Thread and quoted attachment context follow the context visibility key, falling back to the channel defaults and then to all, with allowlist filtering both by the sender allowlists and allowlist-quote filtering thread history while permitting quoted context; DM history is limited in user turns with a per-user override.
Stable AAD object IDs also authorize approval actions.
Clouds, webhook, access, limits
The enabled flag, the app ID, the app password and the tenant ID are the basics. The cloud key selects the Teams SDK environment, public by default, or US government, DoD or China, set together with the service URL for the government clouds; China uses the SDK preset and stored Azure China conversation references with the Graph-backed helpers disabled until Azure China Graph routing ships, and the service URL is the Bot Connector boundary for proactive operations, defaulting for the public cloud and set explicitly for GCC, GCC High or DoD. The webhook port defaults to 3978 and the path to the messages route. The DM policy takes pairing, allowlist, open or disabled with pairing as default, the DM allowlist prefers AAD object IDs, which also authorise approval actions, with the setup wizard resolving names to IDs when Graph access is available, the default target sets the outbound destination and can likewise authorise approvals, and the dangerous name-matching key is the break-glass toggle that re-enables mutable UPN or display-name matching and direct team or channel name routing. The text chunk limit defaults to 4000 and is hard-capped there whatever you configure, the newline chunk mode splits on blank lines before length, the media host allowlist defaults to the Microsoft and Teams domains, the media auth allowlist decides where Authorization headers may be attached on retries, the Graph media fallback opts into Graph lookups when HTML omits file markers, and the media size cap falls back to the agent default.
Overrides, cards, feedback, SSO
- The mention requirement defaults to true and the reply style chooses thread or top-level, both overridable per team and per channel under the teams map keyed by team ID and conversation ID, alongside per-team and per-channel tool policies with allow, deny and also-allow and per-sender tool policies keyed with explicit channel, id, e164, username or name prefixes and the wildcard.
- The auth type, certificate path and thumbprint, managed-identity flag and client ID mirror the authentication page, and the SharePoint site ID names the site used for file uploads in group chats and channels.
- A welcome card and a group welcome card with prompt starters show an Adaptive Card on first DM or group contact, the response prefix prepends text to outbound replies, thumbs-up and thumbs-down feedback is on by default with a negative-feedback reflection follow-up and its cooldown, and the SSO and delegated-auth blocks configure the Bot Framework OAuth connection and delegated Graph scopes, where enabling SSO requires a connection name.
OpenClaw on Microsoft Teams is the channel post these keys belong to, and OpenClaw Microsoft Teams authentication the federated methods behind the auth keys.
IDs, not names
Three keys in the list share one principle: object IDs are stable and names are not, so allowlists, approvals and targets should carry the ID, and the name-matching switch exists only to keep an old install alive while it is migrated. OpenClaw Microsoft Teams manifest and permissions covers the permissions the Graph-backed helpers need, and OpenClaw group chats the cross-channel rules for group conversations these overrides refine.
On Diali
Microsoft Teams is not among the channels Diali connects today: WhatsApp, Telegram, Discord, Slack, Mattermost, Matrix, SMS and voice. Hosted OpenClaw on Diali is the assistant, and Connect your first channel in five minutes shows the channels you can connect in five minutes.
- Only auth keys come from the environment; the rest is config.
- Thread context brings the parent and fifty replies, never their commands.
- 4000 characters per chunk, hard-capped.
Stop reading about it, build one
Set up an agent, pick a channel, and have it working inside the app you already keep open.
