-
Notifications
You must be signed in to change notification settings - Fork 548
[Doc Improvement] Detect App version #14510
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
SirajShaik-MSFT
wants to merge
4
commits into
main
Choose a base branch
from
SirajShaik-MSFT/DetectSessionsSupport
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
107 changes: 107 additions & 0 deletions
107
msteams-platform/bots/how-to/conversations/detect-app-version.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,107 @@ | ||
| --- | ||
| title: Detect installed app version in agent activities | ||
| description: Learn how to use channelData.app.version to determine the installed version of your app and adapt agent behavior based on available features, permissions, or capabilities. | ||
| ms.localizationpriority: medium | ||
| ms.topic: how-to | ||
| ms.date: 07/24/2026 | ||
| zone_pivot_groups: teams-sdk-languages | ||
| --- | ||
|
|
||
| # Detect installed app version in agent activities | ||
|
|
||
| Teams includes the installed app version in all activity payloads delivered to your agent through the `channelData.app.version` field. This field appears in messages, invokes, and `installationUpdate` activities. | ||
|
|
||
| Use the app version to build logic that adapts your agent's behavior based on the version of the app the user has installed. | ||
|
|
||
| ## How it works | ||
|
|
||
| Every activity delivered to your agent in a 1:1 chat includes a `channelData.app` object with the `id` and `version` of the installed app: | ||
|
|
||
| ```json | ||
| { | ||
| "type": "message", | ||
| "conversation": { "id": "conv-id" }, | ||
| "channelData": { | ||
| "app": { | ||
| "id": "your-app-id", | ||
| "version": "1.2.3" | ||
| } | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| The `version` value is the manifest version (`version` property in the app manifest), not a runtime or SDK version. Since different users may have different versions of your app installed, your agent can branch its logic based on this value to determine what features or permissions are available in each user's context. | ||
|
|
||
| ## When to use version detection | ||
|
|
||
| Version detection is useful in several scenarios: | ||
|
|
||
| ### Check feature or permission availability | ||
|
|
||
| If a newer version of your manifest introduces a new capability (such as sessions, new RSC permissions, or additional scopes), your agent can check the installed version and enable or disable functionality accordingly. | ||
|
|
||
| ### Prompt users to update | ||
|
|
||
| When your agent detects an outdated version, it can send a message encouraging the user to update the app to access new features. | ||
|
|
||
| ### Gather install base metrics | ||
|
|
||
| Track version distribution across your user base to understand adoption of newer releases and plan deprecation timelines. | ||
|
|
||
| ### Detect session support | ||
|
|
||
| If your agent has both session-enabled and non-session versions in use, checking the version helps determine whether to create sessions proactively or fall back to the single chat model. For more information, see [Structure conversations with sessions](agent-sessions.md). | ||
|
|
||
| ## Read the version from an activity | ||
|
|
||
| ::: zone pivot="teams-sdk-csharp" | ||
|
|
||
| TODO | ||
|
|
||
| ::: zone-end | ||
|
|
||
| ::: zone pivot="teams-sdk-typescript" | ||
|
|
||
| TODO | ||
|
|
||
| ::: zone-end | ||
|
|
||
| ::: zone pivot="teams-sdk-python" | ||
|
|
||
| TODO | ||
|
|
||
| ::: zone-end | ||
|
|
||
| ## Detect app upgrades | ||
|
|
||
| When a user upgrades the app to a newer version, your agent receives an `installationUpdate` activity with `action: "upgrade"`. The new version is included in `channelData.app.version`: | ||
|
|
||
| ```json | ||
| { | ||
| "type": "installationUpdate", | ||
| "action": "upgrade", | ||
| "conversation": { "id": "base-conversation-id" }, | ||
| "channelData": { | ||
| "app": { | ||
| "version": "2.0.0" | ||
| } | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| The full set of `installationUpdate` actions: | ||
|
|
||
| | Action | When | | ||
| |---|---| | ||
| | `add` | Agent is installed | | ||
| | `remove` | Agent is uninstalled | | ||
| | `upgrade` | App version is upgraded with property value changes | | ||
| | `add-upgrade` | Agent is added as part of an app upgrade | | ||
| | `remove-upgrade` | Agent is removed as part of an app upgrade | | ||
|
|
||
| Use the `upgrade` action to detect version changes and migrate user state, adjust behavior, or trigger setup flows as needed. | ||
|
|
||
| ## See also | ||
|
|
||
| - [Structure conversations with sessions](agent-sessions.md) | ||
| - [Conversation events in your Teams bot](subscribe-to-conversation-events.md) | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe the idea is that it's in all payloads, but we will need to confirm.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whom do we reach out to verify this, Nick Walker (@nickwalkmsft)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I posted a message in the chat about this feature.