Skip to content

Commit 8ecc036

Browse files
authored
Merge pull request #47 from microsoft/remi
banner + feedback
2 parents 9fca563 + bd7a962 commit 8ecc036

File tree

2 files changed

+17
-13
lines changed

2 files changed

+17
-13
lines changed

_posts/2025-11-11-copilot-studio-teams-deployment-ux.md

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,19 @@ title: "Best Practices for Deploying Copilot Studio Agents in Microsoft Teams"
44
date: 2025-11-14 17:30:00 +0100
55
categories: [copilot-studio, teams, deployment]
66
tags: [teams-integration, session-management, state-management, troubleshooting]
7-
description: Essential techniques for managing session state, handling updates, and ensuring reliable performance when deploying Copilot Studio agents to Microsoft Teams.
7+
description: Essential techniques for managing session state, handling updates, and ensuring reliable performance when deploying Copilot Studio Agents to Microsoft Teams.
88
author: raemone
9+
image:
10+
path: /assets/posts/teams-deployment/header.jpeg
11+
alt: "A sleek gradient in Microsoft Teams brand colors (purple and blue) with subtle circuit patterns to suggest technology"
12+
no_bg: true
913
---
1014

11-
Deploying a Copilot Studio agent to Microsoft Teams introduces unique challenges that don't exist in web chat deployments. Sessions persist indefinitely, conversation start events don't fire automatically, and updates can be cached. Understanding these nuances is critical for delivering a reliable user experience.
15+
Deploying a Copilot Studio Agent to Microsoft Teams introduces unique challenges that don't exist in web chat deployments. Sessions persist indefinitely, conversation start events don't fire automatically, and updates can be cached (meaning end-users might not always interact with the latest version). Understanding these nuances is critical for delivering a reliable user experience.
1216

1317
## Why Teams Deployment is Different
1418

15-
- Sessions persist across days or weeks without automatic reset
19+
- Conversation persist across days without automatic reset, this is different from sessions which are an analytical concept and are calculated each time inactivity is triggered
1620
- Conversation Start events don't trigger on initial load
1721
- Stale context and expired tokens can cause unexpected behavior
1822
- Updates may not propagate immediately due to caching
@@ -22,9 +26,9 @@ Deploying a Copilot Studio agent to Microsoft Teams introduces unique challenges
2226

2327
## The Session State Challenge
2428

25-
Unlike web chat where each session starts fresh, Teams conversations maintain state indefinitely. This persistence is powerful for continuity but creates problems:
29+
Unlike [WebChat](https://learn.microsoft.com/en-us/microsoft-copilot-studio/publication-connect-bot-to-web-channels?tabs=preview#add-your-agent-to-your-website) where each session starts fresh, Teams maintain state through a single conversation. This persistence is powerful for continuity but creates problems:
2630

27-
- **Stale Context**: Old conversation data can confuse the AI
31+
- **Stale Context**: Conversation history is not cleared automatically and can confuse the LLM (we use the last 10 turns unless we clear the history)
2832
- **Token Expiration**: Connector authentication expires during long sessions
2933
- **Context Limits**: Accumulated history can hit token limits
3034
- **Update Delays**: Users continue running old bot logic after updates
@@ -80,7 +84,7 @@ This special command forces a complete conversation reset:
8084
- Clears all conversation state
8185
- Removes cached connector information
8286
- Re-authenticates connectors
83-
- Loads latest agent version
87+
- Loads latest Agent version
8488

8589
**When to use:**
8690
- Bot seems "stuck" with outdated information
@@ -94,7 +98,7 @@ This special command forces a complete conversation reset:
9498

9599
**Query rewrite** is a key step in the knowledge pipeline of Copilot Studio. When a user asks a question, the system doesn’t send the raw text directly to the search indexes. Instead, it rewrites the query to optimize it for retrieval across multiple knowledge sources (lexical and semantic). This process ensures better relevance and accuracy of search results.
96100

97-
Enable the **OnKnowledgeRequested** trigger to reveal what the agent is actually searching for:
101+
Enable the **OnKnowledgeRequested** trigger to reveal what the Agent is actually searching for:
98102

99103
**Implementation:**
100104
1. Enable OnKnowledgeRequested trigger (via YAML as this is not yet in the UI)
@@ -115,7 +119,7 @@ This provides read-only access to the refined search query (query rewrite) that
115119
Example: User asks "How do I reset my password?" and bot displays "(debug) Searching HR FAQ for 'reset password'".
116120

117121
![Knowledge Requested Trigger](/assets/posts/teams-deployment/query-rewrite.png)
118-
_You can see both keyword search or semantic search, notice how the second question was rewritten by the agent before search._
122+
_You can see both keyword search or semantic search, notice how the second question was rewritten by the Agent before search._
119123

120124
> Use OnKnowledgeRequested during development to verify query rewrites, then decide whether to keep it visible in production.
121125
{: .prompt-tip }
@@ -124,7 +128,7 @@ _You can see both keyword search or semantic search, notice how the second quest
124128

125129
### Surface Bot Version to Users
126130

127-
Always include a version identifier in your agent responses using the "Greeting" topic or a dedicated "Version" topic:
131+
Always include a version identifier in your Agent responses using the "Greeting" topic or a dedicated "Version" topic:
128132

129133
```
130134
"Contoso Helpdesk Bot – Version 1.3 (Nov 2025)"
@@ -173,7 +177,7 @@ Since ConversationStart won't auto-fire:
173177

174178
Teams users interact conversationally, so:
175179

176-
- Cover common greeting variants in trigger phrases
180+
- Cover common greeting variants in topic description
177181
- Include farewell handling
178182
- Provide multiple example utterances
179183
- Make fallback behavior user-friendly
@@ -186,12 +190,12 @@ Teams users interact conversationally, so:
186190

187191
### Manage Connector Authentication
188192

189-
If using connectors (Power Automate, Graph API, etc.):
193+
If using connectors (ServiceNow, Office, Outlook, etc.):
190194

191195
**Test the authentication flow:**
192196
- Verify login card appears first time
193-
- Ensure token refresh during long conversations
194-
- Plan for connector failures mid-conversation
197+
- Wait for the token to timeout (usually one hour) and try again to verify that connector re-auth automatically
198+
- Modify flow to invalidate the connection and test that it triggers a new consent card in the conversation
195199

196200
**Known issue:** Connectors may not refresh tokens during extended sessions.
197201

232 KB
Loading

0 commit comments

Comments
 (0)