






















@@ -136,63 +136,56 @@ Example:
136136}
137137```
138138139-## How it works
139+## Azure Bot setup
140140141-1. Ensure the Microsoft Teams plugin is available.
142-- Current packaged OpenClaw releases already bundle it.
143-- Older/custom installs can add it manually with the commands above.
144-2. Create an **Azure Bot** (App ID + secret + tenant ID).
145-3. Build a **Teams app package** that references the bot and includes the RSC permissions below.
146-4. Upload/install the Teams app into a team (or personal scope for DMs).
147-5. Configure `msteams` in `~/.openclaw/openclaw.json` (or env vars) and start the gateway.
148-6. The gateway listens for Bot Framework webhook traffic on `/api/messages` by default.
149-150-## Azure Bot Setup (Prerequisites)
141+Before configuring OpenClaw, create an Azure Bot resource and capture its credentials.
151142152-Before configuring OpenClaw, you need to create an Azure Bot resource.
143+<Steps>
144+<Step title="Create the Azure Bot">
145+Go to [Create Azure Bot](https://portal.azure.com/#create/Microsoft.AzureBot) and fill in the **Basics** tab:
153146154-### Step 1: Create Azure Bot
147+| Field | Value |
148+| ------------------ | -------------------------------------------------------- |
149+| **Bot handle** | Your bot name, e.g. `openclaw-msteams` (must be unique) |
150+| **Subscription** | Your Azure subscription |
151+| **Resource group** | Create new or use existing |
152+| **Pricing tier** | **Free** for dev/testing |
153+| **Type of App** | **Single Tenant** (recommended) |
154+| **Creation type** | **Create new Microsoft App ID** |
155155156-1. Go to [Create Azure Bot](https://portal.azure.com/#create/Microsoft.AzureBot)
157-2. Fill in the **Basics** tab:
156+<Note>
157+New multi-tenant bots were deprecated after 2025-07-31. Use **Single Tenant** for new bots.
158+</Note>
158159159-| Field | Value |
160-| ------------------ | -------------------------------------------------------- |
161-| **Bot handle** | Your bot name, e.g., `openclaw-msteams` (must be unique) |
162-| **Subscription** | Select your Azure subscription |
163-| **Resource group** | Create new or use existing |
164-| **Pricing tier** | **Free** for dev/testing |
165-| **Type of App** | **Single Tenant** (recommended - see note below) |
166-| **Creation type** | **Create new Microsoft App ID** |
160+Click **Review + create** → **Create** (wait ~1-2 minutes).
167161168-> **Deprecation notice:** Creation of new multi-tenant bots was deprecated after 2025-07-31. Use **Single Tenant** for new bots.
162+ </Step>
169163170-3. Click **Review + create** → **Create** (wait ~1-2 minutes)
164+<Step title="Capture credentials">
165+From the Azure Bot resource → **Configuration**:
171166172-### Step 2: Get Credentials
167+- copy **Microsoft App ID** → `appId`
168+- **Manage Password** → **Certificates & secrets** → **New client secret** → copy the value → `appPassword`
169+- **Overview** → **Directory (tenant) ID** → `tenantId`
173170174-1. Go to your Azure Bot resource → **Configuration**
175-2. Copy **Microsoft App ID** → this is your `appId`
176-3. Click **Manage Password** → go to the App Registration
177-4. Under **Certificates & secrets** → **New client secret** → copy the **Value** → this is your `appPassword`
178-5. Go to **Overview** → copy **Directory (tenant) ID** → this is your `tenantId`
171+</Step>
179172180-### Step 3: Configure Messaging Endpoint
173+<Step title="Configure messaging endpoint">
174+Azure Bot → **Configuration** → set **Messaging endpoint**:
181175182-1. In Azure Bot → **Configuration**
183-2. Set **Messaging endpoint** to your webhook URL:
184-- Production: `https://your-domain.com/api/messages`
185-- Local dev: Use a tunnel (see [Local Development](#local-development-tunneling) below)
176+- Production: `https://your-domain.com/api/messages`
177+- Local dev: use a tunnel (see [Local development](#local-development-tunneling))
186178187-### Step 4: Enable Teams Channel
179+ </Step>
188180189-1. In Azure Bot → **Channels**
190-2. Click **Microsoft Teams** → Configure → Save
191-3. Accept the Terms of Service
181+<Step title="Enable the Teams channel">
182+Azure Bot → **Channels** → click **Microsoft Teams** → Configure → Save. Accept the Terms of Service.
183+</Step>
184+</Steps>
192185193186<a id="federated-authentication-certificate--managed-identity"></a>
194187195-## Federated Authentication (Certificate + Managed Identity)
188+## Federated authentication
196189197190> Added in 2026.3.24
198191@@ -287,7 +280,7 @@ Use Azure Managed Identity for passwordless authentication. This is ideal for de
287280- `MSTEAMS_USE_MANAGED_IDENTITY=true`
288281- `MSTEAMS_MANAGED_IDENTITY_CLIENT_ID=<client-id>` (only for user-assigned)
289282290-### AKS Workload Identity Setup
283+### AKS workload identity setup
291284292285For AKS deployments using workload identity:
293286@@ -334,7 +327,7 @@ For AKS deployments using workload identity:
334327335328**Default behavior:** When `authType` is not set, OpenClaw defaults to client secret authentication. Existing configurations continue to work without changes.
336329337-## Local Development (Tunneling)
330+## Local development (tunneling)
338331339332Teams can't reach `localhost`. Use a tunnel for local development:
340333@@ -353,7 +346,7 @@ tailscale funnel 3978
353346# Use your Tailscale funnel URL as the messaging endpoint
354347```
355348356-## Teams Developer Portal (Alternative)
349+## Teams Developer Portal (alternative)
357350358351Instead of manually creating a manifest ZIP, you can use the [Teams Developer Portal](https://dev.teams.microsoft.com/apps):
359352@@ -367,7 +360,7 @@ Instead of manually creating a manifest ZIP, you can use the [Teams Developer Po
367360368361This is often easier than hand-editing JSON manifests.
369362370-## Testing the Bot
363+## Testing the bot
371364372365**Option A: Azure Web Chat (verify webhook first)**
373366@@ -456,7 +449,7 @@ The action is gated by `channels.msteams.actions.memberInfo` (default: enabled w
456449- In other words, allowlists gate who can trigger the agent; only specific supplemental context paths are filtered today.
457450- DM history can be limited with `channels.msteams.dmHistoryLimit` (user turns). Per-user overrides: `channels.msteams.dms["<user_id>"].historyLimit`.
458451459-## Current Teams RSC Permissions (Manifest)
452+## Current Teams RSC permissions
460453461454These are the **existing resourceSpecific permissions** in our Teams app manifest. They only apply inside the team/chat where the app is installed.
462455@@ -474,7 +467,7 @@ These are the **existing resourceSpecific permissions** in our Teams app manifes
474467475468- `ChatMessage.Read.Chat` (Application) - receive all group chat messages without @mention
476469477-## Example Teams Manifest (redacted)
470+## Example Teams manifest
478471479472Minimal, valid example with the required fields. Replace IDs and URLs.
480473@@ -547,7 +540,7 @@ To update an already-installed Teams app (e.g., to add RSC permissions):
547540548541## Capabilities: RSC only vs Graph
549542550-### With **Teams RSC only** (app installed, no Graph API permissions)
543+### Teams RSC only (no Graph API permissions)
551544552545Works:
553546@@ -561,7 +554,7 @@ Does NOT work:
561554- Downloading attachments stored in SharePoint/OneDrive.
562555- Reading message history (beyond the live webhook event).
563556564-### With **Teams RSC + Microsoft Graph Application permissions**
557+### Teams RSC plus Microsoft Graph application permissions
565558566559Adds:
567560@@ -593,7 +586,7 @@ If you need images/files in **channels** or want to fetch **message history**, y
593586594587**Additional permission for user mentions:** User @mentions work out of the box for users in the conversation. However, if you want to dynamically search and mention users who are **not in the current conversation**, add `User.Read.All` (Application) permission and grant admin consent.
595588596-## Known Limitations
589+## Known limitations
597590598591### Webhook timeouts
599592@@ -615,48 +608,61 @@ Teams markdown is more limited than Slack or Discord:
615608616609## Configuration
617610618-Key settings (see `/gateway/configuration` for shared channel patterns):
619-620-- `channels.msteams.enabled`: enable/disable the channel.
621-- `channels.msteams.appId`, `channels.msteams.appPassword`, `channels.msteams.tenantId`: bot credentials.
622-- `channels.msteams.webhook.port` (default `3978`)
623-- `channels.msteams.webhook.path` (default `/api/messages`)
624-- `channels.msteams.dmPolicy`: `pairing | allowlist | open | disabled` (default: pairing)
625-- `channels.msteams.allowFrom`: DM allowlist (AAD object IDs recommended). The wizard resolves names to IDs during setup when Graph access is available.
626-- `channels.msteams.dangerouslyAllowNameMatching`: break-glass toggle to re-enable mutable UPN/display-name matching and direct team/channel name routing.
627-- `channels.msteams.textChunkLimit`: outbound text chunk size.
628-- `channels.msteams.chunkMode`: `length` (default) or `newline` to split on blank lines (paragraph boundaries) before length chunking.
629-- `channels.msteams.mediaAllowHosts`: allowlist for inbound attachment hosts (defaults to Microsoft/Teams domains).
630-- `channels.msteams.mediaAuthAllowHosts`: allowlist for attaching Authorization headers on media retries (defaults to Graph + Bot Framework hosts).
631-- `channels.msteams.requireMention`: require @mention in channels/groups (default true).
632-- `channels.msteams.replyStyle`: `thread | top-level` (see [Reply Style](#reply-style-threads-vs-posts)).
633-- `channels.msteams.teams.<teamId>.replyStyle`: per-team override.
634-- `channels.msteams.teams.<teamId>.requireMention`: per-team override.
635-- `channels.msteams.teams.<teamId>.tools`: default per-team tool policy overrides (`allow`/`deny`/`alsoAllow`) used when a channel override is missing.
636-- `channels.msteams.teams.<teamId>.toolsBySender`: default per-team per-sender tool policy overrides (`"*"` wildcard supported).
637-- `channels.msteams.teams.<teamId>.channels.<conversationId>.replyStyle`: per-channel override.
638-- `channels.msteams.teams.<teamId>.channels.<conversationId>.requireMention`: per-channel override.
639-- `channels.msteams.teams.<teamId>.channels.<conversationId>.tools`: per-channel tool policy overrides (`allow`/`deny`/`alsoAllow`).
640-- `channels.msteams.teams.<teamId>.channels.<conversationId>.toolsBySender`: per-channel per-sender tool policy overrides (`"*"` wildcard supported).
641-- `toolsBySender` keys should use explicit prefixes:
642-`id:`, `e164:`, `username:`, `name:` (legacy unprefixed keys still map to `id:` only).
643-- `channels.msteams.actions.memberInfo`: enable or disable the Graph-backed member info action (default: enabled when Graph credentials are available).
644-- `channels.msteams.authType`: authentication type — `"secret"` (default) or `"federated"`.
645-- `channels.msteams.certificatePath`: path to PEM certificate file (federated + certificate auth).
646-- `channels.msteams.certificateThumbprint`: certificate thumbprint (optional, not required for auth).
647-- `channels.msteams.useManagedIdentity`: enable managed identity auth (federated mode).
648-- `channels.msteams.managedIdentityClientId`: client ID for user-assigned managed identity.
649-- `channels.msteams.sharePointSiteId`: SharePoint site ID for file uploads in group chats/channels (see [Sending files in group chats](#sending-files-in-group-chats)).
650-651-## Routing & Sessions
611+Grouped settings (see `/gateway/configuration` for shared channel patterns).
612+613+<AccordionGroup>
614+<Accordion title="Core and webhook">
615+ - `channels.msteams.enabled`
616+ - `channels.msteams.appId`, `appPassword`, `tenantId`: bot credentials
617+ - `channels.msteams.webhook.port` (default `3978`)
618+ - `channels.msteams.webhook.path` (default `/api/messages`)
619+</Accordion>
620+621+<Accordion title="Authentication">
622+ - `authType`: `"secret"` (default) or `"federated"`
623+ - `certificatePath`, `certificateThumbprint`: federated + certificate auth (thumbprint optional)
624+ - `useManagedIdentity`, `managedIdentityClientId`: federated + managed identity auth
625+</Accordion>
626+627+<Accordion title="Access control">
628+ - `dmPolicy`: `pairing | allowlist | open | disabled` (default: pairing)
629+ - `allowFrom`: DM allowlist, prefer AAD object IDs; the wizard resolves names when Graph access is available
630+ - `dangerouslyAllowNameMatching`: break-glass for mutable UPN/display-name and team/channel name routing
631+ - `requireMention`: require @mention in channels/groups (default `true`)
632+</Accordion>
633+634+<Accordion title="Team and channel overrides">
635+All of these override the top-level defaults:
636+637+ - `teams.<teamId>.replyStyle`, `.requireMention`
638+ - `teams.<teamId>.tools`, `.toolsBySender`: per-team tool policy defaults
639+ - `teams.<teamId>.channels.<conversationId>.replyStyle`, `.requireMention`
640+ - `teams.<teamId>.channels.<conversationId>.tools`, `.toolsBySender`
641+642+`toolsBySender` keys accept `id:`, `e164:`, `username:`, `name:` prefixes (unprefixed keys map to `id:`). `"*"` is a wildcard.
643+644+</Accordion>
645+646+<Accordion title="Delivery, media, and actions">
647+ - `textChunkLimit`: outbound text chunk size
648+ - `chunkMode`: `length` (default) or `newline` (split on paragraph boundaries before length)
649+ - `mediaAllowHosts`: inbound attachment host allowlist (defaults to Microsoft/Teams domains)
650+ - `mediaAuthAllowHosts`: hosts that may receive Authorization headers on retries (defaults to Graph + Bot Framework)
651+ - `replyStyle`: `thread | top-level` (see [Reply style](#reply-style-threads-vs-posts))
652+ - `actions.memberInfo`: toggle the Graph-backed member info action (default on when Graph is available)
653+ - `sharePointSiteId`: required for file uploads in group chats/channels (see [Sending files in group chats](#sending-files-in-group-chats))
654+</Accordion>
655+</AccordionGroup>
656+657+## Routing and sessions
652658653659- Session keys follow the standard agent format (see [/concepts/session](/concepts/session)):
654660 - Direct messages share the main session (`agent:<agentId>:<mainKey>`).
655661 - Channel/group messages use conversation id:
656662 - `agent:<agentId>:msteams:channel:<conversationId>`
657663 - `agent:<agentId>:msteams:group:<conversationId>`
658664659-## Reply Style: Threads vs Posts
665+## Reply style: threads vs posts
660666661667Teams recently introduced two channel UI styles over the same underlying data model:
662668@@ -691,7 +697,7 @@ Teams recently introduced two channel UI styles over the same underlying data mo
691697}
692698```
693699694-## Attachments & Images
700+## Attachments and images
695701696702**Current limitations:**
697703@@ -774,7 +780,7 @@ Per-user sharing is more secure as only the chat participants can access the fil
774780775781Uploaded files are stored in a `/OpenClawShared/` folder in the configured SharePoint site's default document library.
776782777-## Polls (Adaptive Cards)
783+## Polls (adaptive cards)
778784779785OpenClaw sends Teams polls as Adaptive Cards (there is no native Teams poll API).
780786@@ -783,7 +789,7 @@ OpenClaw sends Teams polls as Adaptive Cards (there is no native Teams poll API)
783789- The gateway must stay online to record votes.
784790- Polls do not auto-post result summaries yet (inspect the store file if needed).
785791786-## Presentation Cards
792+## Presentation cards
787793788794Send semantic presentation payloads to Teams users or conversations using the `message` tool or CLI. OpenClaw renders them as Teams Adaptive Cards from the generic presentation contract.
789795@@ -871,7 +877,7 @@ Note: Without the `user:` prefix, names default to group/team resolution. Always
871877- Proactive messages are only possible **after** a user has interacted, because we store conversation references at that point.
872878- See `/gateway/configuration` for `dmPolicy` and allowlist gating.
873879874-## Team and Channel IDs (Common Gotcha)
880+## Team and channel IDs
875881876882The `groupId` query parameter in Teams URLs is **NOT** the team ID used for configuration. Extract IDs from the URL path instead:
877883@@ -897,7 +903,7 @@ https://teams.microsoft.com/l/channel/19%3A15bc...%40thread.tacv2/ChannelName?gr
897903- Channel ID = path segment after `/channel/` (URL-decoded)
898904- **Ignore** the `groupId` query parameter
899905900-## Private Channels
906+## Private channels
901907902908Bots have limited support in private channels:
903909此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。