Share via

Does conversation reference json (which is stored in storage account when user install bot agent package) deactivate or became inactive if user has not interacted with bot service for long time?

Nandha Kumar (Harman Connected ServicesCorporatio) 125 Reputation points Microsoft External Staff
2026-01-19T09:43:12.45+00:00

We’re using a bot service. When a user installs the Teams agent package, a new conversation reference JSON is generated and stored in the storage account. This allows us to send proactive message notifications to users. My question is: if a user hasn’t interacted with the bot for a long time, does the conversation reference eventually become inactive or expire? In that case, would sending a Teams notification fail to reach the user?

Azure AI Bot Service
Azure AI Bot Service

An Azure service that provides an integrated environment for bot development.

0 comments No comments

Answer accepted by question author

SRILAKSHMI C 18,990 Reputation points Microsoft External Staff Moderator
2026-01-19T15:19:36.2933333+00:00

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!

Was this answer helpful?

0 comments No comments

1 additional answer

Sort by: Most helpful
  1. AI answer

    2026-01-19T09:43:20.7766667+00:00

    Yes, the conversation reference can become inactive or expire if a user has not interacted with the bot for a long time. In the context of bot services, it is useful to implement a mechanism to track the last time a message was received from a user and clear the state if the time exceeds a preconfigured length. This means that if a user does not interact with the bot within a specified time frame, the conversation reference may no longer be valid, and attempts to send proactive messages could fail.

    To manage this, you can use features like the time-to-live (TTL) in storage solutions such as Cosmos DB to automatically clear state after a certain period. Therefore, if the conversation reference has expired, you would need to acquire a new conversation reference for the user before sending proactive messages again.


    References:

    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.