# Microsoft Teams

![Microsoft-Teams-Emblem.png](https://assets.relyanceuat.xyz/images/docs/12090901405453/12090696138509.png)
Microsoft Teams is a messaging app for your organization. It is a workspace for real-time collaboration and communication, meetings, file and app sharing.

In order to integrate Microsoft Teams with Relyance AI you will need to follow an OAuth2 flow.

#### In the Relyance AI application:

1. Login to your Relyance account.
2. Navigate to the **Settings** Menu in the bottom left-hand side.
3. Select **Integrations**.
4. Click on the **Vendor Integration** tab.
5. Find the **Microsoft Teams** integration card and click it to open its connections.
6. Under **Authentication Method**, choose **Oauth2 / App Token**.
8. Click **Authenticate**.
9. This will bring you to the Microsoft site to authorize Relyance. You may be asked to sign in. Once authorized, you'll be redirected back to Relyance.
10. At this point, you should see the following result on the **Vendor** Integrations page:

![MsTeams-1.png](https://assets.relyanceuat.xyz/images/docs/12090901405453/12090797098509.png)

![MsTeams-2.png](https://assets.relyanceuat.xyz/images/docs/12090901405453/12090760546061.png)

11. Congratulations, you are now connected to **Microsoft Teams**.

### Verify the connection is really working

Relyance reads Teams structure — users, teams, channels and the files shared in
them — through eight Microsoft Graph **application** permissions: `User.Read.All`,
`User.ReadBasic.All`, `GroupMember.Read.All`, `Files.Read.All`, `Team.ReadBasic.All`,
`TeamMember.Read.All`, `Channel.ReadBasic.All` and `ChannelSettings.Read.All`.

1. **Connected but nothing discovered** is admin consent. The token is issued
   whether or not consent was granted, so the connection looks healthy while every
   Graph call is denied. **API permissions** must show "Granted for
   &lt;organization&gt;" against each entry.
2. **Teams and channels appear, but no file contents.** That is `Files.Read.All`,
   which is a separate grant from the Team and Channel permissions — the structure
   comes back and the documents inside it are never read.
3. **Private channels are missing.** They are not covered by `Channel.ReadBasic.All`
   membership reads in the same way public channels are; expect gaps rather than an
   error.

<!-- terraform-examples:begin (generated from the integration catalog; do not hand-edit) -->

## Manage this integration with Terraform

Connections for this integration can be managed as code with the [Relyance Terraform provider](https://registry.terraform.io/providers/Relyance/relyance/latest). Non-secret fields go in `auth.params`; secret fields go in `auth.secrets_wo`, which is write-only — never stored in Terraform state. Rotate secrets by bumping `auth.secrets_wo_version`.

The **OAuth (browser authorization)** method uses a browser authorization flow, so the connection is created in the Relyance app. Manage it in Terraform afterwards by importing it (`terraform import relyance_integration_connection.example microsoft_teams/<connection_id>`) or reading it with the `relyance_integration_connection` data source.

<!-- terraform-examples:end -->
