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

# Microsoft Teams

> Connect your MS Teams account to Saras Agentic AI using Microsoft Graph API for server-to-server orchestration.

## 1. Initial Setup (Azure Portal)

To integrate MS Teams, you must register an application in the **Microsoft Entra ID (formerly Azure AD)** portal.

1. Navigate to the [Azure Portal](https://portal.azure.com/) and sign in as a Global Administrator.
2. Search for and select **Microsoft Entra ID**.
3. In the left sidebar, click **App registrations** > **New registration**.
4. **Name:** Enter `Saras AI`.
5. **Supported account types:** Select **Accounts in this organizational directory only (Single tenant)**.
6. Click **Register**.

## 2. Configuration

### App Credentials

1. From the **Overview** page, copy the following values:
   * **Application (client) ID**
   * **Directory (tenant) ID**
2. In the left sidebar, click **Certificates & secrets** > **Client secrets** > **New client secret**.
3. Add a description (e.g., `Saras AI Secret`) and click **Add**.
4. **Note:** Copy the **Value** of the client secret immediately. This will be required for the integration setup.

### API Permissions

1. In the left sidebar, click **API permissions** > **Add a permission**.
2. Select **Microsoft Graph** > **Application permissions** (Note: Do **not** select Delegated permissions).
3. Search for and select the following permissions:
   * `OnlineMeetings.ReadWrite.All`: Allows the app to create and manage meetings.
   * `OnlineMeetingTranscript.Read.All`: Allows the app to fetch meeting transcripts.
   * `User.Read.All`: Allows the app to identify users in your tenant.
4. Click **Add permissions**.
5. **CRITICAL:** Click **Grant admin consent for \[Your Organization]** and select **Yes** to authorize these permissions.

## 3. Mandatory: Application Access Policy

Unlike Zoom, Microsoft Teams requires an extra security step to allow an application to "act" as a user. A Teams Administrator must run the following commands using the **Microsoft Teams PowerShell** module.

1. **Connect to Microsoft Teams:**
   ```powershell theme={null}
   Connect-MicrosoftTeams
   ```

2. **Create the Access Policy:**
   ```powershell theme={null}
   New-CsApplicationAccessPolicy -Identity "SarasTeamsPolicy" -AppIds "YOUR_APPLICATION_CLIENT_ID" -Description "Allow Saras AI to manage meetings and transcripts"
   ```

3. **Grant the Policy to Users:**
   You can grant this to specific users or globally:
   * **Specific User:**
     ```powershell theme={null}
     Grant-CsApplicationAccessPolicy -PolicyName "SarasTeamsPolicy" -Identity "user@yourdomain.com"
     ```
   * **Globally (Entire Tenant):**
     ```powershell theme={null}
     Grant-CsApplicationAccessPolicy -PolicyName "SarasTeamsPolicy" -Global
     ```

<Note>
  If you are asking the Saras Support team to configure MS Teams for you, kindly share the **Tenant ID**, **Client ID**, and **Client Secret** with them.
</Note>
