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

# Microsoft Teams Integration

> Run CloudThinker operations directly from Microsoft Teams

Transform your Microsoft Teams workspace into a cloud operations command center. Interact with CloudThinker agents, receive alerts, and run operations without leaving Teams.

***

## Prerequisites

<Warning>
  The initial setup **must be performed by a user with one of the following Azure AD roles**:

  * **Global Administrator** — full admin access across all Microsoft 365 services
  * **Teams Administrator** — admin access scoped to Microsoft Teams

  A regular Microsoft 365 user **cannot** complete the setup. If you don't have one of these roles, ask your IT team to perform the initial connection (Steps 1–3 below). Once the bot is published, any user can interact with it in Teams channels.
</Warning>

### Required Azure AD Permissions

During the OAuth flow, CloudThinker requests the following Microsoft Graph API permissions:

| Permission                                        | Type              | Purpose                                             |
| ------------------------------------------------- | ----------------- | --------------------------------------------------- |
| `User.Read`                                       | User consent      | Read the signed-in user's profile                   |
| `Channel.ReadBasic.All`                           | User consent      | List channels in teams                              |
| `Team.ReadBasic.All`                              | User consent      | List teams the user belongs to                      |
| `TeamsAppInstallation.ReadWriteForTeam`           | **Admin consent** | Install the bot into teams                          |
| `TeamsAppInstallation.ReadWriteAndConsentForTeam` | **Admin consent** | Install the bot and grant resource-specific consent |
| `TeamsAppInstallation.ReadWriteSelfForTeam`       | **Admin consent** | Manage the bot's own installation                   |
| `AppCatalog.ReadWrite.All`                        | **Admin consent** | Publish the bot to the organization's app catalog   |
| `Organization.Read.All`                           | **Admin consent** | Read organization information                       |

Permissions marked **Admin consent** can only be granted by a Global Administrator or Teams Administrator. During the OAuth flow, admins will see a **"Consent on behalf of your organization"** checkbox:

* **Checked** — permissions are granted tenant-wide for all users in the Azure AD tenant. Other admins who connect later won't need to re-consent.
* **Unchecked** — permissions are granted only for the admin's own account. This is sufficient to complete the setup since the admin personally has the required role to publish the bot.

### Who Should Perform the Setup?

| Your role                       | What to do                                                                                                                                |
| ------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| **Global Admin or Teams Admin** | You can complete the full setup yourself — proceed to Step 1 below                                                                        |
| **Regular user**                | Ask your Global Admin or Teams Admin to complete Steps 1–3. Once the bot is published, you can use it in any channel where it's installed |

***

## Setup

<Steps>
  <Step title="Navigate to Integrations">
    Go to [**Admin Settings → Integrations**](https://app.cloudthinker.io/admin-settings/integrations) and find **Microsoft Teams**
  </Step>

  <Step title="Connect with Teams">
    Click **Connect with Teams** and authenticate via Microsoft OAuth.

    <Warning>
      You **must** be signed in with a **Global Administrator** or **Teams Administrator** account. If you are a regular user, this step will either:

      * Block you at the Microsoft consent screen, or
      * Appear to succeed but fail silently when publishing the bot to your organization's app catalog

      If you are not an admin, share this page with your IT team and ask them to perform this step.
    </Warning>
  </Step>

  <Step title="Install the Bot">
    Select which Teams to add the CloudThinker bot to and confirm the installation. The bot is published to your organization's Teams app catalog — this is a one-time action.
  </Step>

  <Step title="Map Teams to Workspaces">
    Map your Microsoft Teams to CloudThinker workspaces so agents know which cloud accounts to operate on
  </Step>

  <Step title="Configure Notifications">
    Optionally select channels for each notification type (cost alerts, security findings, incident updates)
  </Step>

  <Step title="Test">
    Try `@CloudThinker alex show AWS costs` in a channel to verify the connection
  </Step>
</Steps>

***

## Syntax

In Teams, prefix all commands with `@CloudThinker`:

```bash theme={null}
@CloudThinker alex analyze EC2 spending trends
@CloudThinker oliver audit security groups for public access
@CloudThinker tony check database performance
@CloudThinker kai review EKS cluster health
```

All [CloudThinker Language](/guide/language) syntax works in Teams — just add the `@CloudThinker` prefix.

***

## Examples

### Quick Queries

```bash theme={null}
@CloudThinker alex what's our AWS spending this week?
@CloudThinker oliver any critical security findings?
@CloudThinker tony why are queries slow on production?
@CloudThinker kai check pod status in payment namespace
```

### With Tools

```bash theme={null}
@CloudThinker alex #dashboard cost trends by service
@CloudThinker oliver #report weekly security summary
@CloudThinker tony #recommend index optimizations
@CloudThinker kai #alert on pod OOMKilled events
```

### Multi-Agent

```bash theme={null}
@CloudThinker anna coordinate investigation of latency spike
@CloudThinker alex and tony analyze database infrastructure costs
```

***

## Alerts

Configure agents to send alerts to Teams channels:

```bash theme={null}
@CloudThinker alex #alert daily spend exceeds $5,000 → #cloud-ops
@CloudThinker oliver #alert security group changes → #security
@CloudThinker kai #alert pod failures in production → #k8s-alerts
```

***

## Code Review Notifications

When an AI code review completes, CloudThinker sends an Adaptive Card notification to your configured Teams channel. The card includes:

* **Severity FactSet** — structured table showing counts by severity level (🔴 Critical, 🟠 High, 🟡 Medium, 🟢 Low)
* **Finding details** — up to 5 unresolved findings with title, severity label, file path, and line number
* **Resolved count** — number of previously identified findings that have been resolved
* **View Code Review** button — direct link to the review dashboard
* **Clean pass** — when no issues are found, a simple "No issues found" message

<Info>
  Configure which Teams channel receives code review notifications and set severity thresholds in **Settings > Notifications > Code Review / Pipeline Monitoring**. See [Notifications Center](/guide/notifications) for details.
</Info>

***

## Channel Patterns

| Channel         | Use Case                                          |
| --------------- | ------------------------------------------------- |
| `#cloud-ops`    | General infrastructure operations and cost alerts |
| `#security`     | Security findings and compliance updates          |
| `#incidents`    | Active incident investigation and coordination    |
| `#code-reviews` | Code review findings and pipeline monitoring      |
| `#reports`      | Scheduled reports and summaries                   |

***

## Troubleshooting

<Accordion title="Agents not responding">
  * Check if the CloudThinker bot is installed in the team
  * Verify you're using `@CloudThinker agent` syntax (not just `agent`)
  * Confirm agents are configured in the CloudThinker console
  * Check Azure AD admin consent status
</Accordion>

<Accordion title="Missing alerts">
  * Check alert configuration in CloudThinker Settings
  * Verify Teams channel notification settings
  * Ensure the bot has permission to post in the target channel
</Accordion>

<Accordion title="Permission errors">
  * **"Missing required permissions"** — The user who connected does not have the Global Administrator or Teams Administrator role. Ask your IT team to perform the initial connection instead.
  * **"Consent on behalf of your organization"** — During OAuth, an admin can check this box to grant permissions tenant-wide. This is optional — if the connecting user is already an admin, their personal consent is sufficient.
  * **Connection appears successful but bot doesn't work** — This can happen if a non-admin user completes the OAuth flow. The user's personal authentication succeeds, but publishing the bot to the app catalog fails silently. Ask a Global Administrator or Teams Administrator to reconnect.
  * For any other permission errors, check workspace admin permissions in CloudThinker, or try removing and re-adding the bot to the team.
</Accordion>

<Accordion title="I'm not an admin — how do I set this up?">
  You need a **Global Administrator** or **Teams Administrator** from your organization to complete the initial connection. Here's what to share with them:

  1. Sign in to CloudThinker (they need a CloudThinker account with admin access to the organization)
  2. Go to [**Admin Settings → Integrations → Microsoft Teams**](https://app.cloudthinker.io/admin-settings/integrations)
  3. Click **Connect with Teams** and complete the Microsoft OAuth flow
  4. The bot will be published to your organization's Teams app catalog

  This is a **one-time setup**. Once the admin completes it, any user in the Teams workspace can interact with the bot by mentioning `@CloudThinker` in channels where the bot is installed.
</Accordion>

***

## Permissions

### Azure AD Permissions

The initial connection requires a **Global Administrator** or **Teams Administrator** in Azure AD. This is because CloudThinker needs to publish a bot to your organization's Teams app catalog, which is an admin-level action. This setup is a one-time operation — once the bot is published, no further admin actions are required.

During OAuth, the admin can optionally check **"Consent on behalf of your organization"** to grant permissions tenant-wide. If unchecked, permissions are granted only for the admin's own account, which is still sufficient to complete the setup. See the [Required Azure AD Permissions](#required-azure-ad-permissions) table above for the full list of requested scopes.

### CloudThinker Permissions

Within Teams, users can only access agents and cloud connections that their CloudThinker account permits. CloudThinker workspace roles apply the same way as they do in the web console.

***

## Related

<CardGroup cols={2}>
  <Card title="CloudThinker Language" icon="code" href="/guide/language">
    Complete syntax reference for all commands
  </Card>

  <Card title="Slack Integration" icon="slack" href="/guide/slack-integration">
    Set up CloudThinker in Slack
  </Card>
</CardGroup>
