> ## Documentation Index
> Fetch the complete documentation index at: https://docs.augmentcode.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Integrate Microsoft Teams

## Introduction

In this page we’ll configure the native MSFT Teams integration and learn how to:

1. Get Teams to notify Cosmos that new messages came in or that Augment/Cosmos was @ mentioned in a conversation
2. Configure Cosmos experts to react to those events, take action and reply back to the existing conversations
3. Deploy a simple expert that replies hello world to a Teams message

```mermaid theme={null}
sequenceDiagram
  autonumber
  participant T as MSFT Teams
  participant A as Augment Code | Cosmos
  T->>A: Webhook: new message and/or new @ mention
  A->>A: Start Expert agent
  A->>T: Add eye emoji to the original post to indicate an agent is looking into it
  A->>A: Expert analyzes message and performs action.
  A->>T: Reply inline with response
```

## Prerequisites

To configure the one-time connectivity between Cosmos and Teams:

**Cosmos**

* you must be a Augment admin

**Teams**

* you must have Teams org-wide admin permissions to:

  * \*\*enable custom apps globally \*\*(Teams Admin Center [https://admin.teams.microsoft.com/](https://admin.teams.microsoft.com/) > Teams apps > Manage apps > Org-wide app settings > Turn on Custom apps)

  <img src="https://mintcdn.com/augment-mtje7p526w/wvxDZZ1En2AtseBb/images/cosmos-integrations/microsoft-teams/microsoft-teams-01.png?fit=max&auto=format&n=wvxDZZ1En2AtseBb&q=85&s=f3f683746f90b57868e9617db525ed33" alt="" width="332" height="187" data-path="images/cosmos-integrations/microsoft-teams/microsoft-teams-01.png" />

  * **update the App Setup Policy**, as the specific user trying to upload the app ZIP file must be assigned an App Setup Policy that permits custom app uploads (Teams Admin Center [https://admin.teams.microsoft.com/](https://admin.teams.microsoft.com/)  > Teams apps > Setup policies > Select the policy (e.g., Global) > Toggle Upload custom apps to On.)

  <img src="https://mintcdn.com/augment-mtje7p526w/wvxDZZ1En2AtseBb/images/cosmos-integrations/microsoft-teams/microsoft-teams-02.png?fit=max&auto=format&n=wvxDZZ1En2AtseBb&q=85&s=97c92b353baf69a851bbc8d1270c1c09" alt="" width="425" height="217" data-path="images/cosmos-integrations/microsoft-teams/microsoft-teams-02.png" />

  * **update Team-Level Setting** (if adding the app directly onto a Team). If a user wants to upload the app ZIP file directly into a specific team, the Team Owner must allow it. (Teams Client [https://teams.cloud.microsoft/](https://teams.cloud.microsoft/) > Go to the Team > More options (...) > Manage team > Settings > Member permissions > Check Allow members to upload custom apps.)

<img src="https://mintcdn.com/augment-mtje7p526w/wvxDZZ1En2AtseBb/images/cosmos-integrations/microsoft-teams/microsoft-teams-03.png?fit=max&auto=format&n=wvxDZZ1En2AtseBb&q=85&s=4c729e9efe4e11ddf7bb0c59c6f5522c" alt="" width="1335" height="928" data-path="images/cosmos-integrations/microsoft-teams/microsoft-teams-03.png" />

Once the app is available in your organization's app store (either an official MSFT app, a verified third-party app, or an approved custom app), installing it into a specific team channel requires the following permissions:

* **App Permission Policy (Admin Level)**: the app must not be blocked by the organization's permission policies. The user installing it must have a policy that marks the app as "Allowed." (Teams Admin Center [https://admin.teams.microsoft.com/](https://admin.teams.microsoft.com/) > **Teams apps** > **Permission policies**.)

<img src="https://mintcdn.com/augment-mtje7p526w/wvxDZZ1En2AtseBb/images/cosmos-integrations/microsoft-teams/microsoft-teams-04.png?fit=max&auto=format&n=wvxDZZ1En2AtseBb&q=85&s=0306dc6a0a3893865e41725a498c1a22" alt="" width="340" height="290" data-path="images/cosmos-integrations/microsoft-teams/microsoft-teams-04.png" />

* **Team Member Permissions (Team Level):** by default, all team members can add apps to channels. However, Team Owners can restrict this (Teams Client [https://teams.cloud.microsoft/](https://teams.cloud.microsoft/) > Go to the Team > **More options (...)** > **Manage team** > **Settings** > **Member permissions**. Ensure **Allow members to add and remove apps** is checked. If unchecked, *only* Team Owners can add apps to the channels.)

<img src="https://mintcdn.com/augment-mtje7p526w/wvxDZZ1En2AtseBb/images/cosmos-integrations/microsoft-teams/microsoft-teams-05.png?fit=max&auto=format&n=wvxDZZ1En2AtseBb&q=85&s=1b91613a5be0e2e9e7aaba214b464869" alt="" width="1335" height="928" data-path="images/cosmos-integrations/microsoft-teams/microsoft-teams-05.png" />

* **Tab Creation Permissions (Team Level):** because apps in channels often manifest as "Tabs" at the top of the channel, you also need to ensure members can manage tabs. (Teams Client [https://teams.cloud.microsoft/](https://teams.cloud.microsoft/) > Go to the Team > **More options (...)** > **Manage team** > **Settings** > **Member permissions.** Ensure **Allow members to create, update, and remove tabs** is checked.)

<img src="https://mintcdn.com/augment-mtje7p526w/wvxDZZ1En2AtseBb/images/cosmos-integrations/microsoft-teams/microsoft-teams-06.png?fit=max&auto=format&n=wvxDZZ1En2AtseBb&q=85&s=e71c1365771fbbde5705cb2ca07e4e55" alt="" width="1335" height="928" data-path="images/cosmos-integrations/microsoft-teams/microsoft-teams-06.png" />

<Note>
  At this moment, a 1on1 session should be scheduled with Augment staff to receive the app ZIP file to be uploaded and run the install. Note: we're leveraging the ZIP/custom app approach at this moment while we're waiting on MSFT to approve the Augment Code app in the Teams marketplace - stay tuned
</Note>

<Note>
  Note: if you don’t see the Teams integrations in your tenant, reach out to your Augment Solution Architect or send Augment a note: [**https://www.augmentcode.com/contact**](https://www.augmentcode.com/contact).
</Note>

## Step 1 - Configure the native Teams integration

As a Teams admin, go to [https://teams.cloud.microsoft/](https://teams.cloud.microsoft/) > left sidebar: Apps > Manage your apps:

<img src="https://mintcdn.com/augment-mtje7p526w/wvxDZZ1En2AtseBb/images/cosmos-integrations/microsoft-teams/microsoft-teams-07.png?fit=max&auto=format&n=wvxDZZ1En2AtseBb&q=85&s=4199b6cd751b16cf74b007d6b355ea4f" alt="" width="1482" height="882" data-path="images/cosmos-integrations/microsoft-teams/microsoft-teams-07.png" />

Click on Upload an app > Upload an app to your org’s app catalog:

<img src="https://mintcdn.com/augment-mtje7p526w/W82vGphL9_f3jMKm/images/cosmos-integrations/microsoft-teams/microsoft-teams-08.png?fit=max&auto=format&n=W82vGphL9_f3jMKm&q=85&s=43a2eb85cfcdea8f6424295fe5c9353e" alt="" width="1158" height="696" data-path="images/cosmos-integrations/microsoft-teams/microsoft-teams-08.png" />

Download the app ZIP file from [https://github.com/augmentcode/integrations/raw/refs/heads/main/augment-teams-app-prod.zip](https://github.com/augmentcode/integrations/raw/refs/heads/main/augment-teams-app-prod.zip) and upload it to Teams

<Note>
  Once MSFT approves the Cosmos application in the Teams marketplace, it’ll replace the app ZIP file approach - stay tuned
</Note>

You should then be redirected to this:

<img src="https://mintcdn.com/augment-mtje7p526w/W82vGphL9_f3jMKm/images/cosmos-integrations/microsoft-teams/microsoft-teams-09.png?fit=max&auto=format&n=W82vGphL9_f3jMKm&q=85&s=11ca7d64541997cbc7e9de4317f505c8" alt="" width="1552" height="884" data-path="images/cosmos-integrations/microsoft-teams/microsoft-teams-09.png" />

Click on Cosmos > Add:

<img src="https://mintcdn.com/augment-mtje7p526w/W82vGphL9_f3jMKm/images/cosmos-integrations/microsoft-teams/microsoft-teams-10.png?fit=max&auto=format&n=W82vGphL9_f3jMKm&q=85&s=f4d7c7abf6115e7b7d1c68b95c93143b" alt="" width="1736" height="1396" data-path="images/cosmos-integrations/microsoft-teams/microsoft-teams-10.png" />

You should see this (**DO NOT SELECT A CHANNEL YET!**):

<img src="https://mintcdn.com/augment-mtje7p526w/W82vGphL9_f3jMKm/images/cosmos-integrations/microsoft-teams/microsoft-teams-11.png?fit=max&auto=format&n=W82vGphL9_f3jMKm&q=85&s=32e56e81528b661f7cc8edbb2d503fa5" alt="" width="978" height="1402" data-path="images/cosmos-integrations/microsoft-teams/microsoft-teams-11.png" />

As an admin, go to Cosmos [https://cosmos.augmentcode.com](https://cosmos.augmentcode.com) > Settings > Integrations > Microsoft Teams > Connect

<img src="https://mintcdn.com/augment-mtje7p526w/W82vGphL9_f3jMKm/images/cosmos-integrations/microsoft-teams/microsoft-teams-12.png?fit=max&auto=format&n=W82vGphL9_f3jMKm&q=85&s=d0b759aa89d24a94a54612c7f3b4e17c" alt="" width="1128" height="996" data-path="images/cosmos-integrations/microsoft-teams/microsoft-teams-12.png" />

Select Consent on behalf of your organization > Click on Accept:

<img src="https://mintcdn.com/augment-mtje7p526w/W82vGphL9_f3jMKm/images/cosmos-integrations/microsoft-teams/microsoft-teams-13.png?fit=max&auto=format&n=W82vGphL9_f3jMKm&q=85&s=ecdfb908017765355afa6f5938e5474a" alt="" width="846" height="1154" data-path="images/cosmos-integrations/microsoft-teams/microsoft-teams-13.png" />

You should see your Microsoft Entra Tenant ID:

<img src="https://mintcdn.com/augment-mtje7p526w/W82vGphL9_f3jMKm/images/cosmos-integrations/microsoft-teams/microsoft-teams-14.png?fit=max&auto=format&n=W82vGphL9_f3jMKm&q=85&s=c0e6c7852e3c5b49cf7fb01d6c20691a" alt="" width="1948" height="610" data-path="images/cosmos-integrations/microsoft-teams/microsoft-teams-14.png" />

Now you can go back to Teams: select a channel and click on Go:

<img src="https://mintcdn.com/augment-mtje7p526w/W82vGphL9_f3jMKm/images/cosmos-integrations/microsoft-teams/microsoft-teams-15.png?fit=max&auto=format&n=W82vGphL9_f3jMKm&q=85&s=2ea93a4910f6dc9841fd3759ef85d8c1" alt="" width="976" height="1402" data-path="images/cosmos-integrations/microsoft-teams/microsoft-teams-15.png" />

Let’s verify that Cosmos was notified that the app was added to a Teams channel: go to Cosmos [https://cosmos.augmentcode.com](https://cosmos.augmentcode.com) > Settings > Automations > Event Log tab. You should see this Microsoft Teams event:

<img src="https://mintcdn.com/augment-mtje7p526w/W82vGphL9_f3jMKm/images/cosmos-integrations/microsoft-teams/microsoft-teams-16.png?fit=max&auto=format&n=W82vGphL9_f3jMKm&q=85&s=32d32581a3b2aa0e6f6c7d28c1e79d0b" alt="" width="1924" height="494" data-path="images/cosmos-integrations/microsoft-teams/microsoft-teams-16.png" />

Click on that event, you’ll see the eventType “teamMemberAdded” (= Cosmos was added as member to this channel):

<img src="https://mintcdn.com/augment-mtje7p526w/W82vGphL9_f3jMKm/images/cosmos-integrations/microsoft-teams/microsoft-teams-17.png?fit=max&auto=format&n=W82vGphL9_f3jMKm&q=85&s=18d2008aa47b54f7a135b26651f3f68d" alt="" width="2006" height="1852" data-path="images/cosmos-integrations/microsoft-teams/microsoft-teams-17.png" />

Teams is properly notifying Cosmos when events occur ✅

## Step 2 - Run a test

Now test the end2end connectivity with a test Q/A expert that will automatically reply to your messages in a given Teams channel.

If you don’t have a Cosmos cloud environment yet, create an empty one for this test: Cosmos > Settings > Environment > Create an environment > Cloud Machine > Name: Test01 > Click on Create Environment.

Go to Cosmos > New session [https://cosmos.augmentcode.com/home](https://cosmos.augmentcode.com/home) > select the Cosmos Advisor expert, make sure the **Microsoft Teams** app is selected and prompt with **Deploy a Q/A test expert that will automatically reply to my messages in the Test-channel-listened-by-bot Teams channel**:

<img src="https://mintcdn.com/augment-mtje7p526w/W82vGphL9_f3jMKm/images/cosmos-integrations/microsoft-teams/microsoft-teams-18.png?fit=max&auto=format&n=W82vGphL9_f3jMKm&q=85&s=393fe69b7dfb37d068524bc8515d7947" alt="" width="795" height="783" data-path="images/cosmos-integrations/microsoft-teams/microsoft-teams-18.png" />

Cosmos Advisor may ask you some clarification questions and then deploy the expert, you should see this:

<img src="https://mintcdn.com/augment-mtje7p526w/W82vGphL9_f3jMKm/images/cosmos-integrations/microsoft-teams/microsoft-teams-19.png?fit=max&auto=format&n=W82vGphL9_f3jMKm&q=85&s=2e4e7e69677f917c20b57db9e087d748" alt="" width="1486" height="1113" data-path="images/cosmos-integrations/microsoft-teams/microsoft-teams-19.png" />

Now go to your Teams channel and run a test by typing **@ Cosmos** with a test message, then observe that Cosmos acknowledges and replies to it:

<img src="https://mintcdn.com/augment-mtje7p526w/W82vGphL9_f3jMKm/images/cosmos-integrations/microsoft-teams/microsoft-teams-20.png?fit=max&auto=format&n=W82vGphL9_f3jMKm&q=85&s=414ebe81ae3f47c5c9cc0d3af700c6e8" alt="" width="2016" height="1166" data-path="images/cosmos-integrations/microsoft-teams/microsoft-teams-20.png" />

Congrats, you can now create Cosmos expert agents that integrate with Teams! ✅
