How Presence works in microsoft Teams - Background Process and Components

 Hello All

Today we are going to see, how presence works in Microsoft teams in the backend process and what are the components are involved for the whole process



Presence is working in two mechanism.

  1.         Publishing Process - Push Method
  2.        Watching Process -Pull Method

 Backend Component

Presence front End Service:

This component will update the current presence to database. This is common for publishing the watching process

Presence Store Database

This is kind of backed database which stores all the users Presence status

Change Feed Service & Notification Center

This tool is playing in between Trouter and Presence Store database which covey the presence to the Trouter 

     Trouter Service

This is key components will have the information of Org ID, Tenant ID, All end point Connections ( it will collect all the information of the users Org ID , Tenant ID , Current Presence, end point URL’s )

Trouter Client or Queue  - This is Internal component will send the notification to the MS Teams Clients

     Presence subscriptions store – Will pull and store the information of presence whenever needed.

            User A wants to see the presence Status of User B

             User A initiate a new chat and check the presence bubble of the user B and pull the presence information and stored it here from the Trouter service

Permission Store – It checks for permission, whether the concerned person having enough permission to see my presence. (Particularly in between Tenants – External Domains)

Publishing Process:

  1. Machine/App State Changes
  2. Presence Client sends publish Presence request to Presence Service
  3. Presence Service creates aggregated Teams Presence
  4. Presence Service stores new presence state to Presence DB
  5. Change feed triggers and fans out notifications to Trouter Service for subscribers
  6. Trouter Service sends batch notifications to each subscriber's Trouter Client
  7. Trouter Client receives the update and passes it to Presence Client
  8. Presence Client confirms delivery, Trouter Client sends response to Trouter Service

 Watching Process:

  1. User A wants to see the presence Status of User B – watching Process
  2. Presence bubbles subscribe for presence updates
  3. Presence stack sends MRIs and Trouter URL to Presence Service to subscribe
  4. Presence Service checks permissions and limits.
  5. Presence Service stores subscriptions for the subscriber and registers with publishers
  6. Presence Service gets a snapshot of subscribed presence.
  7. Presence Service sends the snapshot to Trouter Service for the subscriber
  8. Trouter Service sends the snapshot to the subscriber's Trouter Client.
  9. Trouter Client receives the snapshot and passes it to Presence Stack. Need snapshot so you see original presence you subscribed and see difference.
  10. Presence stack confirms delivery, Trouter Client sends response to Trouter Service. Service will send batch again until receives response back from the client.

Time for Presence status Change. – 5 to 7 Min

 Troubleshooting the presence issue

1.      Clear the MS Teams cache in Windows Client

2.      Check the MS Teams presence in MS Teams on web

Collect the diagnostic and fiddler logs and search for the presence on it 

Hope everyone understand the bankend  process of Microsoft Teams Presence. Happy Learning 😃

Comments