An Azure service that provides an integrated environment for bot development.
Hello Nandha Kumar (Harman Connected ServicesCorporatio),
Welcome to Microsoft Q&A and Thank you for reaching out.
Conversation reference JSON objects do not automatically expire or become inactive simply because a user has not interacted with the bot for a long time. Any expiration behavior depends entirely on how your application manages storage, not on Bot Framework or Teams.
How conversation references work
When a user installs a Teams bot (agent package), a conversation reference is generated and typically stored in your own storage (Azure Storage, Cosmos DB, etc.). This reference enables proactive messaging. The Bot Framework and Microsoft Teams do not apply a built-in time-based expiration to these references.
If a user remains inactive for an extended period:
The conversation reference remains valid in principle
Proactive messages can still be delivered
No automatic cleanup or deactivation occurs by default
Expiration and TTL considerations:
The Bot Framework SDK does not enforce TTL or inactivity expiration
If you configure Cosmos DB TTL or any custom cleanup logic, conversation references may be deleted by your application, not by the platform
Implementing TTL is optional and purely an application-level decision for data lifecycle management
If a conversation reference is deleted due to TTL or custom logic, proactive messages will fail because the reference no longer exists not because it expired naturally.
When proactive messages can fail (even without TTL):
Conversation references can become invalid due to external lifecycle events, such as:
User uninstalling the Teams app
User leaving the tenant or being removed from a team/channel
User account being disabled or deleted
Teams app reinstallation (new conversation reference is created)
Tenant or policy changes
In these cases, proactive message attempts will fail (for example, 403 or 404 errors).
Best practices:
Do not assume inactivity means invalidation
Handle proactive send failures gracefully
Refresh and overwrite conversation references whenever the user interacts with the bot again
Optionally implement TTL or cleanup logic based on your own retention requirements
Track failures and mark references inactive if they repeatedly fail
Conversation references do not expire due to inactivity. Any expiration happens only if your storage configuration (such as TTL) removes them, or if Teams/user lifecycle events invalidate them. Proactive messaging remains reliable as long as the reference is valid and the app remains installed. Please refer this
I Hope this helps. Do let me know if you have any further queries.
Thank you!