

# Connecting Microsoft Teams to Amazon Q Business
<a name="teams-connector"></a>

You can connect Microsoft Teams to Amazon Q Business to index and search your team's messages, channel posts, and files. This connection enables your organization to find relevant information from Teams conversations and shared content through your Amazon Q web experience.

Use the AWS Management Console or the [https://docs.aws.amazon.com/amazonq/latest/api-reference/API_CreateDataSource.html](https://docs.aws.amazon.com/amazonq/latest/api-reference/API_CreateDataSource.html) API to create the connection.

**Topics**
+ [Microsoft Teams connector versions](teams-versions.md)
+ [Known limitations for the Microsoft Teams connector](teams-limitations.md)
+ [Microsoft Teams connector overview](teams-overview.md)
+ [Prerequisites for connecting Amazon Q Business to Microsoft Teams](teams-prereqs.md)
+ [Connecting using the latest Microsoft Teams connector (Console)](teams-console-new.md)
+ [Connecting using the legacy Microsoft Teams connector (Console)](teams-console-original.md)
+ [Connecting Amazon Q Business to Microsoft Teams using APIs](teams-api.md)
+ [Connecting Amazon Q Business to Microsoft Teams using AWS CloudFormation](teams-cfn.md)
+ [How Amazon Q Business connector crawls Microsoft Teams ACLs](teams-user-management.md)
+ [Microsoft Teams data source connector field mappings](teams-field-mappings.md)
+ [IAM role for Microsoft Teams connector](teams-iam-role.md)
+ [Troubleshooting your Microsoft Teams connector](teams-troubleshooting.md)

**Learn more**
+ For an overview of the Amazon Q web experience creation process using IAM Identity Center, see [Configuring an application using IAM Identity Center](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/create-application.html).
+ For an overview of the Amazon Q web experience creation process using AWS Identity and Access Management, see [Configuring an application using IAM](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/create-application-iam.html).
+ For an overview of connector features, see [Data source connector concepts](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/connector-concepts.html).
+ For information about connector configuration best practices, see [Connector configuration best practices](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/connector-best-practices.html).

# Microsoft Teams connector versions
<a name="teams-versions"></a>

You can choose between two Microsoft Teams connector versions:

## Latest Microsoft Teams connector (recommended)
<a name="teams-new-connector-overview"></a>

**Note**  
The latest connector provides improved accuracy. We recommend using the latest connector for new implementations. The legacy connector remains available if you need specific features not yet supported in the latest connector.

The latest Microsoft Teams connector offers a simplified configuration experience with the following features:
+ Chat messages and channel posts syncing
+ Simplified sync scope without channel wiki
+ Date range filters only
+ Enhanced UI layout with improved spacing
+ Application-level permissions for enhanced security
+ Automatic crawling of ACL and identity information

## Legacy Microsoft Teams connector
<a name="teams-original-connector-overview"></a>

The legacy Microsoft Teams connector provides full-featured configuration with advanced options:
+ Complete sync scope including calendar meetings, channel wiki, and attachments
+ Advanced filtering options with team names, channel names, and attachment sections
+ Custom field mappings for metadata extraction
+ Configurable sync modes and VPC settings
+ Regex pattern matching for complex attachment filtering
+ Manual ACL and identity crawling configuration

# Known limitations for the Microsoft Teams connector
<a name="teams-limitations"></a>

**Note**  
**Original version notice:** We recommend using the new connector for improved performance and retrieval quality. The following limitations apply only to the original connector version.

When you use the test data source connection feature, the Microsoft Teams connector has a potential issue when testing Identity Crawler. If testing takes longer than five minutes, Amazon Q skips testing Identity Crawler and moves on to the next test. A connection error with Identity Crawler is possible even after finishing connection testing.

The Microsoft Teams connector has these known limitations:
+ When you enable Access Control Lists (ACLs), the "Sync only new or modified content" option is not available due to Microsoft Teams API limitations. Use "Full sync" or "New, modified, or deleted content sync" modes instead, or disable ACLs to use this sync mode.

# Microsoft Teams connector overview
<a name="teams-overview"></a>

The following table shows the Amazon Q Business Microsoft Teams connector features and capabilities.


****  
[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/teams-overview.html)

# Prerequisites for connecting Amazon Q Business to Microsoft Teams
<a name="teams-prereqs"></a>

Before you begin, make sure that you have completed the following prerequisites.

**In Microsoft Teams, make sure you have:**
+ Created a Microsoft Teams account in Office 365.
+ Copied your Microsoft 365 Tenant ID. You can find your Tenant ID in the Properties of your Azure Active Directory Portal. You need this URL to allow Amazon Q to connect with your Microsoft Teams data source. For more information, see [Register a Microsoft Entra app and create a service principal](https://learn.microsoft.com/en-us/entra/identity-platform/howto-create-service-principal-portal#sign-in-to-the-application) on the Microsoft website.
+ Configured an OAuth 2.0 credential token containing a client ID and client secret. For more information, see [Azure documentation on managing access tokens for Teams](https://learn.microsoft.com/en-us/azure/communication-services/quickstarts/manage-teams-identity?pivots=programming-language-csharp) on the Microsoft website.
+ Added the necessary permissions. You can choose to add all permissions, or you can limit the scope by selecting fewer permissions based on which entities you want to crawl. *(Application level permissions required for new connector)* All permissions must be at *application* level, not delegated. The following table shows permissions by corresponding entity.    
[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/teams-prereqs.html)
+ Generated Microsoft Teams OAuth 2.0 credentials containing a client ID, client secret, username, and password. You need these credentials to authenticate Amazon Q to access Microsoft Teams.

**In your AWS account, make sure you have:**
+ Created a Amazon Q Business application.
+ Created a [Amazon Q Business retriever and added an index](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/select-retriever.html).
+ Created an [IAM role](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/iam-roles.html#iam-roles-ds) for your data source and, if using the Amazon Q API, noted the ARN of the IAM role.
+ Stored your Microsoft Teams authentication credentials in an AWS Secrets Manager secret and, if using the Amazon Q API, noted the ARN of the secret.
**Note**  
If you’re a console user, you can create the IAM role and Secrets Manager secret as part of configuring your Amazon Q application on the console.

For a list of things to consider while configuring your data source, see [ Data source connector configuration best practices](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/connector-best-practices.html).

# Connecting using the latest Microsoft Teams connector (Console)
<a name="teams-console-new"></a>

The latest Microsoft Teams connector provides a simplified configuration experience with essential features. Use this procedure to connect Amazon Q Business to Microsoft Teams using the latest connector.

**To connect Amazon Q to Microsoft Teams using the latest connector**

1. Sign in to the AWS Management Console and open the Amazon Q Business console.

1. From the left navigation menu, choose **Data sources**.

1. From the **Data sources** page, choose **Add data source**.

1. Then, on the **Add data sources** page, from **Data sources**, add the **Microsoft Teams** data source to your Amazon Q application.

1. Then, on the **Microsoft Teams** data source page, enter the following information:

1. **Name and description**, do the following:
   + For **Data source name** – Name your data source for easy tracking.
**Note**  
You can include hyphens (-) but not spaces. Maximum of 1,000 alphanumeric characters.
   + **Description – *optional*** – Add an optional description for your data source. This text is viewed only by Amazon Q Business administrators and can be edited later.

1. In **Source**, enter the following information:

   1. **Tenant ID** – Enter your Tenant ID.
**Note**  
Your Microsoft Tenant ID is a globally unique identifier that's necessary to configure each connector instance. Your Tenant ID is different from your organization name or domain and can be found in the **Properties** section of your Azure Active Directory Portal.

1. For **Authentication**, in **AWS Secrets Manager** – Choose between **Create and add new secret** and **Use existing secrets**.

   1. If you choose **Use existing secrets**, select an existing secret.

     If you choose **Create and add a new secret**, enter the following information in the **Create AWS Secrets Manager secret** section:

     1. **Secret name** – A name for your secret.

     1. **Client ID** – Enter the Client ID you generated after registering your application for use. You can find this Client ID in **App registrations** in your Azure Active Directory Portal.

     1. **Client Secret** – Enter the client secret that you generated from your Teams account. 

1. **IAM role** – Choose an existing IAM role or create an IAM role to access your repository credentials and index content.
**Note**  
Creating a new service IAM role is recommended.

   For more information, see [IAM role](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/teams-connector.html#teams-iam).

1. **Sync scope** – Choose the content you want to sync.

   1. Choose **All** to crawl and sync all your documents.

   1. For **Chat**, choose from the following options:

      1. Choose **Chat** to crawl and sync all chats. If you choose this option, Amazon Q Business also crawls **Chat messages** by default.

      1. Choose **Chat messages** to crawl and sync only all chat messages.

   1. For **Teams**, choose from the following options:

      1. Choose **Teams** to crawl and sync all teams. If you choose this option, Amazon Q Business also crawls **Channel posts** by default.

      1. Choose **Channel posts** to crawl and sync only all channel posts.

   1. **Advanced settings**

      **Document deletion safeguard** - *optional*–To safeguard your documents from deletion during a sync job, select **On** and enter an integer between 0 - 100. If the percentage of documents to be deleted in your sync job exceeds the percentage you selected, the delete phase will be skipped and no documents from this data source will be deleted from your index. For more information, see [Document deletion safeguard](connector-concepts.md#document-deletion-safeguard).

1. In **Additional configuration – *optional***, configure the following simplified options:
   + **Date Range** – Enter the date range for which the connector will crawl your content. End date is optional. Rolling window options available: Last [X] Days/Weeks/Months.
**Note**  
**Simplified configuration:** The latest connector automatically handles entity selection with ACL enabled by default to keep the configuration simple and reliable.

1. In **Sync run schedule**, for **Frequency** – Choose how often Amazon Q will sync with your data source. For more details, see [Sync run schedule](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/connector-concepts.html#connector-sync-run). To learn how to start a data sync job, see [Starting data source connector sync jobs](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/supported-datasource-actions.html#start-datasource-sync-jobs).

1. **Tags - *optional*** – Add tags to search and filter your resources or track your AWS costs. See [Tags](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/tagging.html) for more details.

1. In **Data source details**, choose **Sync now** to allow Amazon Q to begin syncing (crawling and ingesting) data from your data source. When the sync job finishes, your data source is ready to use.
**Note**  
View CloudWatch logs for your data source sync job by selecting **View CloudWatch logs**. If you encounter a `Resource not found exception` error, wait and try again as logs may not be available immediately.  
You can also view a detailed document-level report by selecting **View Report**. This report shows the status of each document during the crawl, sync, and index stages, including any errors. If the report is empty for an in-progress job, check back later as data is emitted to the report as events occur during the sync process.  
For more information, see [Troubleshooting data source connectors](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/troubleshooting-data-sources.html#troubleshooting-data-sources-not-indexed).

# Connecting using the legacy Microsoft Teams connector (Console)
<a name="teams-console-original"></a>

The legacy Microsoft Teams connector provides comprehensive configuration options including entity type selection, field mappings, and VPC settings. Use this procedure to connect Amazon Q Business to Microsoft Teams using the legacy connector.

**To connect Amazon Q to Microsoft Teams using the legacy connector**

1. Sign in to the AWS Management Console and open the Amazon Q Business console.

1. From the left navigation menu, choose **Data sources**.

1. From the **Data sources** page, choose **Add data source**.

1. Then, on the **Add data sources** page, from **Data sources**, add the **Microsoft Teams** data source to your Amazon Q application.

1. Then, on the **Microsoft Teams** data source page, enter the following information:

1. **Name and description**, do the following:
   + For **Data source name** – Name your data source for easy tracking.
**Note**  
You can include hyphens (-) but not spaces. Maximum of 1,000 alphanumeric characters.
   + **Description – *optional*** – Add an optional description for your data source. This text is viewed only by Amazon Q Business administrators and can be edited later.

1. In **Source**, enter the following information:

   1. **Tenant ID** – Enter your Tenant ID.
**Note**  
Your Microsoft Tenant ID is a globally unique identifier that's necessary to configure each connector instance. Your Tenant ID is different from your organization name or domain and can be found in the **Properties** section of your Azure Active Directory Portal.

1. **Authorization** – Amazon Q Business crawls ACL information by default to ensure responses are generated only from documents your end users have access to. If supported for your connector, you can manage ACLs by selecting ** Enable ACLs ** to enable ACLs or **Disable ACLs** to disable them. To manage ACLs, you need specific IAM permissions. See [Grant permission to create data sources with ACLs disabled](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/setting-up.html#DisableAclOnDataSource) for more details. See [Authorization](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/connector-concepts.html#connector-authorization) for more details.

1. For **Authentication**, in **AWS Secrets Manager** – Choose between **Create and add new secret** and **Use existing secrets**.

   1. If you choose **Use existing secrets**, select an existing secret.

     If you choose **Create and add a new secret**, enter the following information in the **Create AWS Secrets Manager secret** section:

     1. **Secret name** – A name for your secret.

     1. **Client ID** – Enter the Client ID you generated after registering your application for use. You can find this Client ID in **App registrations** in your Azure Active Directory Portal.

     1. **Client Secret** – Enter the client secret that you generated from your Teams account. 

1. **Payment model** – Choose the payment model associated with your Microsoft Teams account. Model A payment models are restricted to licensing and payment models that require security compliance. Model B payment models are suitable for licensing and payment models that don't require security compliance.

1. **IAM role** – Choose an existing IAM role or create an IAM role to access your repository credentials and index content.
**Note**  
Creating a new service IAM role is recommended.

   For more information, see [IAM role](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/teams-connector.html#teams-iam).

1. **Sync scope** – Choose the content you want to sync.

   1. Choose **All** to crawl and sync all your documents.

   1. For **Chat**, choose from the following options:

      1. Choose **Chat** to crawl and sync all chats. If you choose this option, Amazon Q Business also crawls **Chat messages** and **Chat files** by default.

      1. Choose **Chat messages** to crawl and sync only all chat messages.

      1. Choose **Chat files** to crawl and sync only all chat files.

   1. For **Teams**, choose from the following options:

      1. Choose **Teams** to crawl and sync all teams. If you choose this option, Amazon Q Business also crawls **Channel posts**, **Channel files and folders** and **Channel wiki** by default.

      1. Choose **Channel posts** to crawl and sync only all channel posts.

      1. Choose **Channel files and folders** to crawl and sync only all channel files and folders.

      1. Choose **Channel wiki** to crawl and sync only all channel wikis.

   1. For **Calendar**, choose from the following options:

      1. Choose **Calendar** to crawl and sync your calendar. If you choose this option, Amazon Q Business also crawls **Meetings**, **Meeting chats**, **Meeting files** and **Meeting notes** by default.

      1. Choose **Meetings** to crawl and sync only all meetings.

      1. Choose **Meeting chats** to crawl and sync only all meeting chats.

      1. Choose **Meeting files** to crawl and sync only all meeting files.

      1. Choose **Meeting notes** to crawl and sync only all meeting notes.

   1. **Multi-media content configuration – optional** – To enable content extraction from embedded images and visuals in documents, choose **Visual content in documents**.

      To extract audio transcriptions and video content, enable processing for the following file types:

   1. **Advanced settings**

      **Document deletion safeguard** - *optional*–To safeguard your documents from deletion during a sync job, select **On** and enter an integer between 0 - 100. If the percentage of documents to be deleted in your sync job exceeds the percentage you selected, the delete phase will be skipped and no documents from this data source will be deleted from your index. For more information, see [Document deletion safeguard](connector-concepts.md#document-deletion-safeguard).

1. For **Maximum file size** – Specify the file size limit in MBs that Amazon Q will crawl. Amazon Q will crawl only the files within the size limit you define. The default file size is 50MB. The maximum file size should be greater than 0MB and less than or equal to 50MB.

1. In **Additional configuration – *optional***, configure the following comprehensive options:
   +  **Calendar crawling** – Enter the date range for which the connector will crawl your calendar content.
   +  **User email** – Enter the emails of the users you want to include in your application.
   +  **Team names** – Add patterns to include or exclude teams found in Microsoft Teams from your application.
   +  **Channel names** – Add patterns to include or exclude channels found in Microsoft Teams from your application.
   + **Attachment regex patterns** – Add regular expression patterns to include or exclude certain attachment for all supported entities. You can add up to 100 patterns.

1. **Field mappings** – A list of data source document attributes to map to your index fields.
**Note**  
Add or update the fields from the **Data source details** page after you finish adding your data source. You can choose from two types of fields: 

   1. **Default** – Automatically created by Amazon Q on your behalf based on common fields in your data source. You can't edit these.

   1. **Custom** – Automatically created by Amazon Q on your behalf based on common fields in your data source. You can edit these. You can also create and add new custom fields.
**Note**  
Support for adding custom fields varies by connector. You won't see the **Add field** option if your connector doesn't support adding custom fields.

   For more information, see [Field mappings](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/connector-concepts.html#connector-field-mappings).

1. **Configure VPC and security group – *optional*** – Choose whether you want to use a VPC. If you do, enter the following information:

   1. **Subnets** – Select up to 6 repository subnets that define the subnets and IP ranges the repository instance uses in the selected VPC.

   1. **VPC security groups** – Choose up to 10 security groups that allow access to your data source. Ensure that the security group allows incoming traffic from Amazon EC2 instances and devices outside your VPC. For databases, security group instances are required. 

   For more information, see [VPC](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/connector-concepts.html#connector-vpc).

1. In **Sync run schedule**, for **Frequency** – Choose how often Amazon Q will sync with your data source. For more details, see [Sync run schedule](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/connector-concepts.html#connector-sync-run). To learn how to start a data sync job, see [Starting data source connector sync jobs](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/supported-datasource-actions.html#start-datasource-sync-jobs).

1. **Tags - *optional*** – Add tags to search and filter your resources or track your AWS costs. See [Tags](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/tagging.html) for more details.

1. In **Data source details**, choose **Sync now** to allow Amazon Q to begin syncing (crawling and ingesting) data from your data source. When the sync job finishes, your data source is ready to use.
**Note**  
View CloudWatch logs for your data source sync job by selecting **View CloudWatch logs**. If you encounter a `Resource not found exception` error, wait and try again as logs may not be available immediately.  
You can also view a detailed document-level report by selecting **View Report**. This report shows the status of each document during the crawl, sync, and index stages, including any errors. If the report is empty for an in-progress job, check back later as data is emitted to the report as events occur during the sync process.  
For more information, see [Troubleshooting data source connectors](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/troubleshooting-data-sources.html#troubleshooting-data-sources-not-indexed).

# Connecting Amazon Q Business to Microsoft Teams using APIs
<a name="teams-api"></a>

You use the [CreateDataSource](https://docs.aws.amazon.com/amazonq/latest/api-reference/API_CreateDataSource.html) action to connect a data source to your Amazon Q application. You can also use the [UpdateDataSource](https://docs.aws.amazon.com/amazonq/latest/api-reference/API_UpdateDataSource.html) action to modify an existing data source configuration.

Then, you use the `configuration` parameter to provide a JSON blob that conforms the AWS-defined JSON schema.

For an example of the API request, see [CreateDataSource](https://docs.aws.amazon.com/amazonq/latest/api-reference/API_CreateDataSource.html) and [UpdateDataSource](https://docs.aws.amazon.com/amazonq/latest/api-reference/API_UpdateDataSource.html) in the Amazon Q API Reference.

**Topics**
+ [Connecting Amazon Q Business to Microsoft Teams (new connector) using APIs](teams-new-api.md)
+ [Connecting Amazon Q Business to Microsoft Teams (Original connector) using APIs](teams-original-api.md)

# Connecting Amazon Q Business to Microsoft Teams (new connector) using APIs
<a name="teams-new-api"></a>

You use the [CreateDataSource](https://docs.aws.amazon.com/amazonq/latest/api-reference/API_CreateDataSource.html) action to connect a data source to your Amazon Q application. You can also use the [UpdateDataSource](https://docs.aws.amazon.com/amazonq/latest/api-reference/API_UpdateDataSource.html) action to modify an existing data source configuration.

Then, you use the `configuration` parameter to provide a JSON blob that conforms the AWS-defined JSON schema.

For an example of the API request, see [CreateDataSource](https://docs.aws.amazon.com/amazonq/latest/api-reference/API_CreateDataSource.html) and [UpdateDataSource](https://docs.aws.amazon.com/amazonq/latest/api-reference/API_UpdateDataSource.html) in the Amazon Q API Reference.

## Microsoft Teams new connector JSON schema
<a name="teams-new-json"></a>

The following is the Microsoft Teams new connector JSON schema:

```
{
  "$schema": "https://json-schema.org/draft-07/schema#",
  "$id": "https://amazonaws.com/plato/connector/configuration/msteams",
  "title": "Microsoft Teams Configuration Schema",
  "description": "JSON Schema for Microsoft Teams data connector configuration based on Smithy model",
  "type": "object",
  "properties": {
    "type": {
      "type": "string",
      "enum": [
        "MSTEAMSV2"
      ],
      "description": "The connector type identifier"
    },
    "connectionConfiguration": {
      "type": "object",
      "description": "Configuration for connecting to Microsoft Teams",
      "properties": {
        "tenantId": {
          "type": "string",
          "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
          "minLength": 36,
          "maxLength": 36,
          "description": "Microsoft Teams tenant ID in UUID v4 format"
        },
        "secretArn": {
          "type": "string",
          "pattern": "^arn:[a-z0-9-\\.]{1,63}:[a-z0-9-\\.]{0,63}:[a-z0-9-\\.]{0,63}:[a-z0-9-\\.]{0,63}:[^/].{0,1023}$",
          "description": "ARN of the AWS Secrets Manager secret containing authentication credentials"
        }
      },
      "required": ["tenantId", "secretArn"],
      "additionalProperties": false
    },
    "filterConfiguration": {
      "type": "object",
      "description": "Configuration for filtering data based on date ranges",
      "properties": {
        "startDateFilter": {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(?:\\.\\d+)?(?:Z|[+-]\\d{2}:\\d{2})$",
          "description": "Start date for filtering data in ISO 8601 format"
        },
        "endDateFilter": {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(?:\\.\\d+)?(?:Z|[+-]\\d{2}:\\d{2})$",
          "description": "End date for filtering data in ISO 8601 format"
        }
      },
      "additionalProperties": false
    },
    "dataEntityConfiguration": {
      "type": "object",
      "description": "Configuration for specifying which data entities to crawl",
      "properties": {
        "crawlChatMessages": {
          "type": "boolean",
          "description": "Whether to crawl chat messages from Microsoft Teams"
        },
        "crawlChannelPosts": {
          "type": "boolean",
          "description": "Whether to crawl channel posts from Microsoft Teams"
        }
      },
      "additionalProperties": false
    },
    "deletionProtectionConfiguration": {
      "type": "object",
      "description": "Configuration for deletion protection settings",
      "properties": {
        "enableDeletionProtection": {
          "type": "boolean",
          "description": "Whether to enable deletion protection"
        },
        "deletionProtectionThreshold": {
          "type": "string",
          "pattern": "^(100|[1-9][0-9]?)$",
          "description": "Deletion protection threshold as a percentage (1-100)"
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "type",
    "connectionConfiguration",
    "dataEntityConfiguration"
  ],
  "additionalProperties": false,
  "examples": [
    {
      "type": "MSTEAMSV2",
      "connectionConfiguration": {
        "tenantId": "12345678-1234-4123-8123-123456789012",
        "secretArn": "arn:aws:secretsmanager:us-east-1:123456789012:secret:msteams-credentials-AbCdEf"
      },
      "filterConfiguration": {
        "startDateFilter": "2024-01-01T00:00:00Z",
        "endDateFilter": "2024-12-31T23:59:59Z"
      },
      "dataEntityConfiguration": {
        "crawlChatMessages": true,
        "crawlChannelPosts": true
      },
      "deletionProtectionConfiguration": {
        "enableDeletionProtection": true,
        "deletionProtectionThreshold": "10"
      }
    }
  ]
}
```

The following table provides information about important JSON keys to configure for the new Microsoft Teams connector.


| Configuration | Description | 
| --- | --- | 
| type | The type of data source. Must be MSTEAMSV2 for the new Teams connector. | 
| connectionConfiguration | Configuration information for connecting to the Teams data source. | 
| tenantId | The Microsoft Teams tenant ID in UUID v4 format. | 
| secretArn | The Amazon Resource Name (ARN) of a Secrets Manager secret that contains the key-value pairs required to connect to your Microsoft Teams. | 
| dataEntityConfiguration | Configuration for the types of data entities to crawl from Teams. | 
| crawlChatMessages | A Boolean value to specify whether to crawl chat messages. Set to true to include chat messages in the crawl, or false to exclude them. | 
| crawlChannelPosts | A Boolean value to specify whether to crawl channel posts. Set to true to include channel posts in the crawl, or false to exclude them. | 
| filterConfiguration | Optional configuration for filtering content during the crawl process. | 
| startDateFilter | Specify the start date for filtering content. Only content created on or after this date will be crawled. Format: ISO 8601 date-time format. | 
| endDateFilter | Specify the end date for filtering content. Only content created on or before this date will be crawled. Format: ISO 8601 date-time format. | 
| deletionProtectionConfiguration | Optional configuration to protect against accidental deletion of large amounts of content. | 
| enableDeletionProtection | A Boolean value to enable deletion protection. When enabled, the connector will not delete more than the specified threshold of documents in a single sync. | 
| deletionProtectionThreshold | The maximum percentage of documents that can be deleted in a single sync when deletion protection is enabled. Specify as a string containing a number from 1 to 100. | 

# Connecting Amazon Q Business to Microsoft Teams (Original connector) using APIs
<a name="teams-original-api"></a>

You use the [CreateDataSource](https://docs.aws.amazon.com/amazonq/latest/api-reference/API_CreateDataSource.html) action to connect a data source to your Amazon Q application. You can also use the [UpdateDataSource](https://docs.aws.amazon.com/amazonq/latest/api-reference/API_UpdateDataSource.html) action to modify an existing data source configuration.

Then, you use the `configuration` parameter to provide a JSON blob that conforms the AWS-defined JSON schema.

For an example of the API request, see [CreateDataSource](https://docs.aws.amazon.com/amazonq/latest/api-reference/API_CreateDataSource.html) and [UpdateDataSource](https://docs.aws.amazon.com/amazonq/latest/api-reference/API_UpdateDataSource.html) in the Amazon Q API Reference.

## Microsoft Teams configuration properties
<a name="teams-configuration-keys"></a>

The following provides information about important configuration properties required in the schema.


| Configuration | Description | Type | Required | 
| --- | --- | --- | --- | 
| `connectionConfiguration` | Configuration information for endpoint for the data source. | `object` This property has the following sub-property: `repositoryEndpointMetadata`. | Yes | 
| `repositoryEndpointMetadata` | The endpoint information for the data source. | `object` This property has the following sub-property: `tenantId`. | Yes | 
| `tenantId` | The Microsoft 365 tenant ID. You can find your tenant ID in the Properties of your Azure Active Directory Portal. | `string` The string must be 36 characters long and in in the pattern: ^[0-9a-f]\$18\$1-[0-9a-f]\$14\$1-[0-9a-f]\$14\$1-[0-9a-f]\$14\$1-[0-9a-f]\$112\$1\$1 | Yes | 
| `repositoryConfigurations` | Configuration information for the content of the data source. For example, configuring specific types of content and field mappings. | `object` This property has the following sub-properties: [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/teams-original-api.html) | Yes | 
|  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/teams-original-api.html)  | A list of objects that map the attributes or field names of your Microsoft Teams content to Amazon Q index field names. | `object` These properties have the following sub-properties: `indexFieldName`, `indexFieldType`, `dataSourceFieldName`, and `dateFieldFormat`. | No | 
| `indexFieldName` | The field name of your Microsoft Teams assets. | `string`  | Yes | 
| `indexFieldType` | The field type of your Microsoft Teams assets. | `string` The allowed values are `STRING`, `STRING_LIST`, `DATE`, and `LONG`.  | Yes | 
| `dataSourceFieldName` | The data source field name of your Microsoft Teams assets. | `string`  | Yes | 
| `dateFieldFormat` | The date format of your Microsoft Teams assets. | `string` Specify the date format in the form `yyyy-MM-dd'T'HH:mm:ss'Z'`  | No | 
| `additionalProperties` | Additional configuration options for your content in your data source. | `object` This property has the following sub-properties. [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/teams-original-api.html) | Yes | 
| `isCrawlAcl` | Specify true to crawl access control information from documents.  Amazon Q Business crawls ACL information by default to ensure responses are generated only from documents your end users have access to. See [Authorization](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/connector-concepts.html#connector-authorization) for more details.  | `boolean` | No | 
| `maxFileSizeInMegaBytes` | Specify the maximum single file size limit in MBs that Amazon Q will crawl. Amazon Q will crawl only the files within the size limit you define. The default file size is 50MB. The maximum file size should be greater than 0MB and less than or equal to 50MB. | `string` | No | 
| `fieldForUserId` | Specify the field to use for UserId for ACL crawling. | `string` | No | 
|  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/teams-original-api.html)  | Specify true to index this content in your Microsoft Teams data source. | `boolean` | No | 
|  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/teams-original-api.html)  | A list of regular expression patterns to include specific content in your Microsoft Teams data source. Content that matches the patterns are included in the index. Content that doesn't match the patterns are excluded from the index. If any content matches both an inclusion and exclusion pattern, the exclusion pattern takes precedence, and the content isn't included in the index. | `array (string)` | No | 
|  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/teams-original-api.html)  | A list of regular expression patterns to exclude specific content in your Microsoft Teams data source. Content that matches the patterns are excluded from the index. Content that doesn't match the patterns are included in the index. If any content matches both an inclusion and exclusion pattern, the exclusion pattern takes precedence, and the content isn't included in the index. | `array (string)` | No | 
|  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/teams-original-api.html)  | You can choose to configure a startCalendarDateTime and endCalendarDateTime parameters so that the Microsoft Teams connector crawls content based on a specific date range. | `string` Specify the date in the form `^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}Z$)` | No | 
| `paymentModel` | Specifies what type of payment model to use with your Teams data source. Model A payment models are restricted to licensing and payment models that require security compliance. Model B payment models are suitable for licensing and payment models that don't require security compliance. | `string` Valid values are `A`, `B`, and `Evaluation Mode`. | No | 
| `syncMode` | Specify whether Amazon Q should update your index by syncing all documents or only new, modified, and deleted documents.  | `string` You can choose between the following options: [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/teams-original-api.html) | Yes | 
| `secretARN` | The Amazon Resource Name (ARN) of an AWS Secrets Manager secret that contains the key-value pairs required to connect to your Microsoft Teams. | `string` The secret must contain a JSON structure with the following keys: <pre>{<br />  "clientId": String,<br />  "clientSecret": String<br />}</pre> | Yes | 
| `type` | The type of data source. Specify MSTEAMS as your data source type. | `string` | Yes | 
| `enableIdentityCrawler` | `true` to activate identity crawler.Crawling identity information on users and groups with access to specific documents is useful for user context filtering. Search results are filtered based on the user or their group access to documents.  Amazon Q Business crawls identity information from your data source by default to ensure responses are generated only from documents end users have access to. For more information, see [Identity crawler](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/connector-concepts.html#connector-identity-crawler).  | `boolean` | No | 
| `version` | The version of this template that's currently supported. | `string` | No | 

## Microsoft Teams JSON schema
<a name="teams-json"></a>

The following is the Microsoft Teams JSON schema:

```
{
  "type": "object",
  "properties": {
    "type": {
      "type": "string",
      "pattern": "MSTEAMS"
    },
    "syncMode": {
      "type": "string",
      "enum": ["FORCED_FULL_CRAWL", "FULL_CRAWL", "CHANGE_LOG"]
    },
    "secretArn": {
      "type": "string",
      "minLength": 20,
      "maxLength": 2048
    },
    "enableIdentityCrawler": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "string",
          "enum": ["true", "false"]
        }
      ]
    },
    "connectionConfiguration": {
      "type": "object",
      "properties": {
        "repositoryEndpointMetadata": {
          "type": "object",
          "properties": {
            "tenantId": {
              "type": "string",
              "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$",
              "minLength": 36,
              "maxLength": 36
            }
          },
          "required": ["tenantId"]
        }
      },
      "required": ["repositoryEndpointMetadata"]
    },
    "repositoryConfigurations": {
      "type": "object",
      "properties": {
        "chatMessage": {
          "type": "object",
          "properties": {
            "fieldMappings": {
              "type": "array",
              "items": [
                {
                  "type": "object",
                  "properties": {
                    "indexFieldName": {
                      "type": "string"
                    },
                    "indexFieldType": {
                      "type": "string",
                      "enum": ["STRING", "STRING_LIST", "DATE"]
                    },
                    "dataSourceFieldName": {
                      "type": "string"
                    },
                    "dateFieldFormat": {
                      "type": "string",
                      "pattern": "yyyy-MM-dd'T'HH:mm:ss'Z'"
                    }
                  },
                  "required": [
                    "indexFieldName",
                    "indexFieldType",
                    "dataSourceFieldName"
                  ]
                }
              ]
            }
          },
          "required": ["fieldMappings"]
        },
        "chatAttachment": {
          "type": "object",
          "properties": {
            "fieldMappings": {
              "type": "array",
              "items": [
                {
                  "type": "object",
                  "properties": {
                    "indexFieldName": {
                      "type": "string"
                    },
                    "indexFieldType": {
                      "type": "string",
                      "enum": ["STRING", "DATE", "LONG"]
                    },
                    "dataSourceFieldName": {
                      "type": "string"
                    },
                    "dateFieldFormat": {
                      "type": "string",
                      "pattern": "yyyy-MM-dd'T'HH:mm:ss'Z'"
                    }
                  },
                  "required": [
                    "indexFieldName",
                    "indexFieldType",
                    "dataSourceFieldName"
                  ]
                }
              ]
            }
          },
          "required": ["fieldMappings"]
        },
        "channelPost": {
          "type": "object",
          "properties": {
            "fieldMappings": {
              "type": "array",
              "items": [
                {
                  "type": "object",
                  "properties": {
                    "indexFieldName": {
                      "type": "string"
                    },
                    "indexFieldType": {
                      "type": "string",
                      "enum": ["STRING", "STRING_LIST", "DATE"]
                    },
                    "dataSourceFieldName": {
                      "type": "string"
                    },
                    "dateFieldFormat": {
                      "type": "string",
                      "pattern": "yyyy-MM-dd'T'HH:mm:ss'Z'"
                    }
                  },
                  "required": [
                    "indexFieldName",
                    "indexFieldType",
                    "dataSourceFieldName"
                  ]
                }
              ]
            }
          },
          "required": ["fieldMappings"]
        },
        "channelWiki": {
          "type": "object",
          "properties": {
            "fieldMappings": {
              "type": "array",
              "items": [
                {
                  "type": "object",
                  "properties": {
                    "indexFieldName": {
                      "type": "string"
                    },
                    "indexFieldType": {
                      "type": "string",
                      "enum": ["STRING", "DATE", "LONG"]
                    },
                    "dataSourceFieldName": {
                      "type": "string"
                    },
                    "dateFieldFormat": {
                      "type": "string",
                      "pattern": "yyyy-MM-dd'T'HH:mm:ss'Z'"
                    }
                  },
                  "required": [
                    "indexFieldName",
                    "indexFieldType",
                    "dataSourceFieldName"
                  ]
                }
              ]
            }
          },
          "required": ["fieldMappings"]
        },
        "channelAttachment": {
          "type": "object",
          "properties": {
            "fieldMappings": {
              "type": "array",
              "items": [
                {
                  "type": "object",
                  "properties": {
                    "indexFieldName": {
                      "type": "string"
                    },
                    "indexFieldType": {
                      "type": "string",
                      "enum": ["STRING", "DATE", "LONG"]
                    },
                    "dataSourceFieldName": {
                      "type": "string"
                    },
                    "dateFieldFormat": {
                      "type": "string",
                      "pattern": "yyyy-MM-dd'T'HH:mm:ss'Z'"
                    }
                  },
                  "required": [
                    "indexFieldName",
                    "indexFieldType",
                    "dataSourceFieldName"
                  ]
                }
              ]
            }
          },
          "required": ["fieldMappings"]
        },
        "meetingChat": {
          "type": "object",
          "properties": {
            "fieldMappings": {
              "type": "array",
              "items": [
                {
                  "type": "object",
                  "properties": {
                    "indexFieldName": {
                      "type": "string"
                    },
                    "indexFieldType": {
                      "type": "string",
                      "enum": ["STRING", "STRING_LIST", "DATE"]
                    },
                    "dataSourceFieldName": {
                      "type": "string"
                    },
                    "dateFieldFormat": {
                      "type": "string",
                      "pattern": "yyyy-MM-dd'T'HH:mm:ss'Z'"
                    }
                  },
                  "required": [
                    "indexFieldName",
                    "indexFieldType",
                    "dataSourceFieldName"
                  ]
                }
              ]
            }
          },
          "required": ["fieldMappings"]
        },
        "meetingFile": {
          "type": "object",
          "properties": {
            "fieldMappings": {
              "type": "array",
              "items": [
                {
                  "type": "object",
                  "properties": {
                    "indexFieldName": {
                      "type": "string"
                    },
                    "indexFieldType": {
                      "type": "string",
                      "enum": ["STRING", "DATE", "LONG"]
                    },
                    "dataSourceFieldName": {
                      "type": "string"
                    },
                    "dateFieldFormat": {
                      "type": "string",
                      "pattern": "yyyy-MM-dd'T'HH:mm:ss'Z'"
                    }
                  },
                  "required": [
                    "indexFieldName",
                    "indexFieldType",
                    "dataSourceFieldName"
                  ]
                }
              ]
            }
          },
          "required": ["fieldMappings"]
        },
        "meetingNote": {
          "type": "object",
          "properties": {
            "fieldMappings": {
              "type": "array",
              "items": [
                {
                  "type": "object",
                  "properties": {
                    "indexFieldName": {
                      "type": "string"
                    },
                    "indexFieldType": {
                      "type": "string",
                      "enum": ["STRING", "DATE"]
                    },
                    "dataSourceFieldName": {
                      "type": "string"
                    },
                    "dateFieldFormat": {
                      "type": "string",
                      "pattern": "yyyy-MM-dd'T'HH:mm:ss'Z'"
                    }
                  },
                  "required": [
                    "indexFieldName",
                    "indexFieldType",
                    "dataSourceFieldName"
                  ]
                }
              ]
            }
          },
          "required": ["fieldMappings"]
        },
        "calendarMeeting": {
          "type": "object",
          "properties": {
            "fieldMappings": {
              "type": "array",
              "items": [
                {
                  "type": "object",
                  "properties": {
                    "indexFieldName": {
                      "type": "string"
                    },
                    "indexFieldType": {
                      "type": "string",
                      "enum": ["STRING", "DATE"]
                    },
                    "dataSourceFieldName": {
                      "type": "string"
                    },
                    "dateFieldFormat": {
                      "type": "string",
                      "pattern": "yyyy-MM-dd'T'HH:mm:ss'Z'"
                    }
                  },
                  "required": [
                    "indexFieldName",
                    "indexFieldType",
                    "dataSourceFieldName"
                  ]
                }
              ]
            }
          },
          "required": ["fieldMappings"]
        }
      }
    },
    "additionalProperties": {
      "type": "object",
      "properties": {
        "isCrawlAcl": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "string",
              "enum": ["true", "false"]
            }
          ]
        },
        "maxFileSizeInMegaBytes": {
          "type": "string"
        },
        "fieldForUserId": {
          "type": "string"
        },
        "paymentModel": {
          "type": "string",
          "enum": ["A", "B", "Evaluation Mode"]
        },
        "inclusionTeamNameFilter": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "exclusionTeamNameFilter": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "inclusionChannelNameFilter": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "exclusionChannelNameFilter": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "inclusionFileNamePatterns": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "exclusionFileNamePatterns": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "inclusionFileTypePatterns": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "exclusionFileTypePatterns": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "inclusionUserEmailFilter": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "isCrawlChatMessage": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "string",
              "enum": ["true", "false"]
            }
          ]
        },
        "isCrawlChatAttachment": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "string",
              "enum": ["true", "false"]
            }
          ]
        },
        "isCrawlChannelPost": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "string",
              "enum": ["true", "false"]
            }
          ]
        },
        "isCrawlChannelAttachment": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "string",
              "enum": ["true", "false"]
            }
          ]
        },
        "isCrawlChannelWiki": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "string",
              "enum": ["true", "false"]
            }
          ]
        },
        "isCrawlCalendarMeeting": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "string",
              "enum": ["true", "false"]
            }
          ]
        },
        "isCrawlMeetingChat": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "string",
              "enum": ["true", "false"]
            }
          ]
        },
        "isCrawlMeetingFile": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "string",
              "enum": ["true", "false"]
            }
          ]
        },
        "isCrawlMeetingNote": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "string",
              "enum": ["true", "false"]
            }
          ]
        },
        "startCalendarDateTime": {
          "anyOf": [
            {
              "type": "string",
              "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}Z$"
            },
            {
              "type": "string",
              "pattern": ""
            }
          ]
        },
        "endCalendarDateTime": {
          "anyOf": [
            {
              "type": "string",
              "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}Z$"
            },
            {
              "type": "string",
              "pattern": ""
            }
          ]
        },
        "enableDeletionProtection": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "string",
              "enum": ["true", "false"]
            }
          ],
          "default": false
        },
        "deletionProtectionThreshold": {
          "type": "string",
          "default": "15"
        }
      },
      "required": []
    },
    "version": {
      "type": "string",
      "anyOf": [
        {
          "pattern": "1.0.0"
        }
      ]
    },
    "required": [
      "type",
      "syncMode",
      "secretArn",
      "connectionConfiguration",
      "repositoryConfigurations",
      "additionalProperties"
    ]
  }
}
```

## Microsoft Teams JSON schema example
<a name="teams-api-json-example"></a>

The following is the Microsoft Teams JSON schema example:

```
{
  "type": "MSTEAMS",
  "syncMode": "FULL_CRAWL",
  "secretArn": "arn:aws:secretsmanager:us-west-2:123456789012:secret:my-teams-secret",
  "enableIdentityCrawler": "true",
  "connectionConfiguration": {
    "repositoryEndpointMetadata": {
      "tenantId": "123e4567-e89b-12d3-a456-426614174000"
    }
  },
  "repositoryConfigurations": {
    "chatMessage": {
      "fieldMappings": [
        {
          "indexFieldName": "message_id",
          "indexFieldType": "STRING",
          "dataSourceFieldName": "id",
          "dateFieldFormat": "yyyy-MM-dd'T'HH:mm:ss'Z'"
        }
      ]
    },
    "chatAttachment": {
      "fieldMappings": [
        {
          "indexFieldName": "attachment_id",
          "indexFieldType": "STRING",
          "dataSourceFieldName": "id",
          "dateFieldFormat": "yyyy-MM-dd'T'HH:mm:ss'Z'"
        }
      ]
    },
    "channelPost": {
      "fieldMappings": [
        {
          "indexFieldName": "post_id",
          "indexFieldType": "STRING",
          "dataSourceFieldName": "id",
          "dateFieldFormat": "yyyy-MM-dd'T'HH:mm:ss'Z'"
        }
      ]
    },
    "channelWiki": {
      "fieldMappings": [
        {
          "indexFieldName": "wiki_id",
          "indexFieldType": "STRING",
          "dataSourceFieldName": "id",
          "dateFieldFormat": "yyyy-MM-dd'T'HH:mm:ss'Z'"
        }
      ]
    },
    "channelAttachment": {
      "fieldMappings": [
        {
          "indexFieldName": "attachment_id",
          "indexFieldType": "STRING",
          "dataSourceFieldName": "id",
          "dateFieldFormat": "yyyy-MM-dd'T'HH:mm:ss'Z'"
        }
      ]
    },
    "meetingChat": {
      "fieldMappings": [
        {
          "indexFieldName": "meeting_chat_id",
          "indexFieldType": "STRING",
          "dataSourceFieldName": "id",
          "dateFieldFormat": "yyyy-MM-dd'T'HH:mm:ss'Z'"
        }
      ]
    },
    "meetingFile": {
      "fieldMappings": [
        {
          "indexFieldName": "meeting_file_id",
          "indexFieldType": "STRING",
          "dataSourceFieldName": "id",
          "dateFieldFormat": "yyyy-MM-dd'T'HH:mm:ss'Z'"
        }
      ]
    },
    "meetingNote": {
      "fieldMappings": [
        {
          "indexFieldName": "meeting_note_id",
          "indexFieldType": "STRING",
          "dataSourceFieldName": "id",
          "dateFieldFormat": "yyyy-MM-dd'T'HH:mm:ss'Z'"
        }
      ]
    },
    "calendarMeeting": {
      "fieldMappings": [
        {
          "indexFieldName": "calendar_meeting_id",
          "indexFieldType": "STRING",
          "dataSourceFieldName": "id",
          "dateFieldFormat": "yyyy-MM-dd'T'HH:mm:ss'Z'"
        }
      ]
    }
  },
  "additionalProperties": {
    "isCrawlAcl": "true",
    "maxFileSizeInMegaBytes": "50",
    "fieldForUserId": "user_id",
    "paymentModel": "A",
    "inclusionTeamNameFilter": ["TeamA", "TeamB"],
    "exclusionTeamNameFilter": ["TeamC"],
    "inclusionChannelNameFilter": ["Channel1", "Channel2"],
    "exclusionChannelNameFilter": ["Channel3"],
    "inclusionFileNamePatterns": ["*.docx", "*.pdf"],
    "exclusionFileNamePatterns": ["*.tmp"],
    "inclusionFileTypePatterns": ["image/png", "image/jpeg"],
    "exclusionFileTypePatterns": ["application/octet-stream"],
    "inclusionUserEmailFilter": ["user@example.com"],
    "isCrawlChatMessage": "true",
    "isCrawlChatAttachment": "true",
    "isCrawlChannelPost": "true",
    "isCrawlChannelAttachment": "true",
    "isCrawlChannelWiki": "true",
    "isCrawlCalendarMeeting": "true",
    "isCrawlMeetingChat": "true",
    "isCrawlMeetingFile": "true",
    "isCrawlMeetingNote": "true",
    "startCalendarDateTime": "2023-01-01T00:00:00Z",
    "endCalendarDateTime": "2023-12-31T23:59:59Z",
    "enableDeletionProtection": "false",
    "deletionProtectionThreshold": "15"
  }
}
```

# Connecting Amazon Q Business to Microsoft Teams using AWS CloudFormation
<a name="teams-cfn"></a>

You use the [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-qbusiness-datasource.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-qbusiness-datasource.html) resource to connect a data source to your Amazon Q application.

Use the [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-qbusiness-datasource.html#cfn-qbusiness-datasource-applicationid](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-qbusiness-datasource.html#cfn-qbusiness-datasource-applicationid) property to provide a JSON or YAML schema with the necessary configuration details specific to your data source connector.

To learn more about AWS CloudFormation, see [What is AWS CloudFormation?](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/Welcome.html) in the *CloudFormation User Guide*.

## Microsoft Teams configuration properties
<a name="teams-configuration-keys"></a>

The following provides information about important configuration properties required in the schema.


| Configuration | Description | Type | Required | 
| --- | --- | --- | --- | 
| `connectionConfiguration` | Configuration information for endpoint for the data source. | `object` This property has the following sub-property: `repositoryEndpointMetadata`. | Yes | 
| `repositoryEndpointMetadata` | The endpoint information for the data source. | `object` This property has the following sub-property: `tenantId`. | Yes | 
| `tenantId` | The Microsoft 365 tenant ID. You can find your tenant ID in the Properties of your Azure Active Directory Portal. | `string` The string must be 36 characters long and in in the pattern: ^[0-9a-f]\$18\$1-[0-9a-f]\$14\$1-[0-9a-f]\$14\$1-[0-9a-f]\$14\$1-[0-9a-f]\$112\$1\$1 | Yes | 
| `repositoryConfigurations` | Configuration information for the content of the data source. For example, configuring specific types of content and field mappings. | `object` This property has the following sub-properties: [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/teams-cfn.html) | Yes | 
|  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/teams-cfn.html)  | A list of objects that map the attributes or field names of your Microsoft Teams content to Amazon Q index field names. | `object` These properties have the following sub-properties: `indexFieldName`, `indexFieldType`, `dataSourceFieldName`, and `dateFieldFormat`. | No | 
| `indexFieldName` | The field name of your Microsoft Teams assets. | `string`  | Yes | 
| `indexFieldType` | The field type of your Microsoft Teams assets. | `string` The allowed values are `STRING`, `STRING_LIST`, `DATE`, and `LONG`.  | Yes | 
| `dataSourceFieldName` | The data source field name of your Microsoft Teams assets. | `string`  | Yes | 
| `dateFieldFormat` | The date format of your Microsoft Teams assets. | `string` Specify the date format in the form `yyyy-MM-dd'T'HH:mm:ss'Z'`  | No | 
| `additionalProperties` | Additional configuration options for your content in your data source. | `object` This property has the following sub-properties. [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/teams-cfn.html) | Yes | 
| `isCrawlAcl` | Specify true to crawl access control information from documents.  Amazon Q Business crawls ACL information by default to ensure responses are generated only from documents your end users have access to. See [Authorization](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/connector-concepts.html#connector-authorization) for more details.  | `boolean` | No | 
| `maxFileSizeInMegaBytes` | Specify the maximum single file size limit in MBs that Amazon Q will crawl. Amazon Q will crawl only the files within the size limit you define. The default file size is 50MB. The maximum file size should be greater than 0MB and less than or equal to 50MB. | `string` | No | 
| `fieldForUserId` | Specify the field to use for UserId for ACL crawling. | `string` | No | 
|  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/teams-cfn.html)  | Specify true to index this content in your Microsoft Teams data source. | `boolean` | No | 
|  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/teams-cfn.html)  | A list of regular expression patterns to include specific content in your Microsoft Teams data source. Content that matches the patterns are included in the index. Content that doesn't match the patterns are excluded from the index. If any content matches both an inclusion and exclusion pattern, the exclusion pattern takes precedence, and the content isn't included in the index. | `array (string)` | No | 
|  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/teams-cfn.html)  | A list of regular expression patterns to exclude specific content in your Microsoft Teams data source. Content that matches the patterns are excluded from the index. Content that doesn't match the patterns are included in the index. If any content matches both an inclusion and exclusion pattern, the exclusion pattern takes precedence, and the content isn't included in the index. | `array (string)` | No | 
|  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/teams-cfn.html)  | You can choose to configure a startCalendarDateTime and endCalendarDateTime parameters so that the Microsoft Teams connector crawls content based on a specific date range. | `string` Specify the date in the form `^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}Z$)` | No | 
| `paymentModel` | Specifies what type of payment model to use with your Teams data source. Model A payment models are restricted to licensing and payment models that require security compliance. Model B payment models are suitable for licensing and payment models that don't require security compliance. | `string` Valid values are `A`, `B`, and `Evaluation Mode`. | No | 
| `syncMode` | Specify whether Amazon Q should update your index by syncing all documents or only new, modified, and deleted documents.  | `string` You can choose between the following options: [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/teams-cfn.html) | Yes | 
| `secretARN` | The Amazon Resource Name (ARN) of an AWS Secrets Manager secret that contains the key-value pairs required to connect to your Microsoft Teams. | `string` The secret must contain a JSON structure with the following keys: <pre>{<br />  "clientId": String,<br />  "clientSecret": String<br />}</pre> | Yes | 
| `type` | The type of data source. Specify MSTEAMS as your data source type. | `string` | Yes | 
| `enableIdentityCrawler` | `true` to activate identity crawler.Crawling identity information on users and groups with access to specific documents is useful for user context filtering. Search results are filtered based on the user or their group access to documents.  Amazon Q Business crawls identity information from your data source by default to ensure responses are generated only from documents end users have access to. For more information, see [Identity crawler](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/connector-concepts.html#connector-identity-crawler).  | `boolean` | No | 
| `version` | The version of this template that's currently supported. | `string` | No | 

## Microsoft Teams JSON schema for using the CloudFormation


## Microsoft Teams JSON schema for using the configuration property with AWS CloudFormation
<a name="teams-cfn-json"></a>

The following is the Microsoft Teams JSON schema and examples for the configuration property for AWS CloudFormation.

**Topics**
+ [Microsoft Teams JSON schema for using the configuration property with AWS CloudFormation](#teams-cfn-json-schema)
+ [Microsoft Teams JSON schema example for using the configuration property with AWS CloudFormation](#teams-cfn-json-example)

### Microsoft Teams JSON schema for using the configuration property with AWS CloudFormation
<a name="teams-cfn-json-schema"></a>

The following is the Microsoft Teams JSON schema for the configuration property for CloudFormation

```
{
  "type": "object",
  "properties": {
    "type": {
      "type": "string",
      "pattern": "MSTEAMS"
    },
    "syncMode": {
      "type": "string",
      "enum": ["FORCED_FULL_CRAWL", "FULL_CRAWL", "CHANGE_LOG"]
    },
    "secretArn": {
      "type": "string",
      "minLength": 20,
      "maxLength": 2048
    },
    "enableIdentityCrawler": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "string",
          "enum": ["true", "false"]
        }
      ]
    },
    "connectionConfiguration": {
      "type": "object",
      "properties": {
        "repositoryEndpointMetadata": {
          "type": "object",
          "properties": {
            "tenantId": {
              "type": "string",
              "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$",
              "minLength": 36,
              "maxLength": 36
            }
          },
          "required": ["tenantId"]
        }
      },
      "required": ["repositoryEndpointMetadata"]
    },
    "repositoryConfigurations": {
      "type": "object",
      "properties": {
        "chatMessage": {
          "type": "object",
          "properties": {
            "fieldMappings": {
              "type": "array",
              "items": [
                {
                  "type": "object",
                  "properties": {
                    "indexFieldName": {
                      "type": "string"
                    },
                    "indexFieldType": {
                      "type": "string",
                      "enum": ["STRING", "STRING_LIST", "DATE"]
                    },
                    "dataSourceFieldName": {
                      "type": "string"
                    },
                    "dateFieldFormat": {
                      "type": "string",
                      "pattern": "yyyy-MM-dd'T'HH:mm:ss'Z'"
                    }
                  },
                  "required": [
                    "indexFieldName",
                    "indexFieldType",
                    "dataSourceFieldName"
                  ]
                }
              ]
            }
          },
          "required": ["fieldMappings"]
        },
        "chatAttachment": {
          "type": "object",
          "properties": {
            "fieldMappings": {
              "type": "array",
              "items": [
                {
                  "type": "object",
                  "properties": {
                    "indexFieldName": {
                      "type": "string"
                    },
                    "indexFieldType": {
                      "type": "string",
                      "enum": ["STRING", "DATE", "LONG"]
                    },
                    "dataSourceFieldName": {
                      "type": "string"
                    },
                    "dateFieldFormat": {
                      "type": "string",
                      "pattern": "yyyy-MM-dd'T'HH:mm:ss'Z'"
                    }
                  },
                  "required": [
                    "indexFieldName",
                    "indexFieldType",
                    "dataSourceFieldName"
                  ]
                }
              ]
            }
          },
          "required": ["fieldMappings"]
        },
        "channelPost": {
          "type": "object",
          "properties": {
            "fieldMappings": {
              "type": "array",
              "items": [
                {
                  "type": "object",
                  "properties": {
                    "indexFieldName": {
                      "type": "string"
                    },
                    "indexFieldType": {
                      "type": "string",
                      "enum": ["STRING", "STRING_LIST", "DATE"]
                    },
                    "dataSourceFieldName": {
                      "type": "string"
                    },
                    "dateFieldFormat": {
                      "type": "string",
                      "pattern": "yyyy-MM-dd'T'HH:mm:ss'Z'"
                    }
                  },
                  "required": [
                    "indexFieldName",
                    "indexFieldType",
                    "dataSourceFieldName"
                  ]
                }
              ]
            }
          },
          "required": ["fieldMappings"]
        },
        "channelWiki": {
          "type": "object",
          "properties": {
            "fieldMappings": {
              "type": "array",
              "items": [
                {
                  "type": "object",
                  "properties": {
                    "indexFieldName": {
                      "type": "string"
                    },
                    "indexFieldType": {
                      "type": "string",
                      "enum": ["STRING", "DATE", "LONG"]
                    },
                    "dataSourceFieldName": {
                      "type": "string"
                    },
                    "dateFieldFormat": {
                      "type": "string",
                      "pattern": "yyyy-MM-dd'T'HH:mm:ss'Z'"
                    }
                  },
                  "required": [
                    "indexFieldName",
                    "indexFieldType",
                    "dataSourceFieldName"
                  ]
                }
              ]
            }
          },
          "required": ["fieldMappings"]
        },
        "channelAttachment": {
          "type": "object",
          "properties": {
            "fieldMappings": {
              "type": "array",
              "items": [
                {
                  "type": "object",
                  "properties": {
                    "indexFieldName": {
                      "type": "string"
                    },
                    "indexFieldType": {
                      "type": "string",
                      "enum": ["STRING", "DATE", "LONG"]
                    },
                    "dataSourceFieldName": {
                      "type": "string"
                    },
                    "dateFieldFormat": {
                      "type": "string",
                      "pattern": "yyyy-MM-dd'T'HH:mm:ss'Z'"
                    }
                  },
                  "required": [
                    "indexFieldName",
                    "indexFieldType",
                    "dataSourceFieldName"
                  ]
                }
              ]
            }
          },
          "required": ["fieldMappings"]
        },
        "meetingChat": {
          "type": "object",
          "properties": {
            "fieldMappings": {
              "type": "array",
              "items": [
                {
                  "type": "object",
                  "properties": {
                    "indexFieldName": {
                      "type": "string"
                    },
                    "indexFieldType": {
                      "type": "string",
                      "enum": ["STRING", "STRING_LIST", "DATE"]
                    },
                    "dataSourceFieldName": {
                      "type": "string"
                    },
                    "dateFieldFormat": {
                      "type": "string",
                      "pattern": "yyyy-MM-dd'T'HH:mm:ss'Z'"
                    }
                  },
                  "required": [
                    "indexFieldName",
                    "indexFieldType",
                    "dataSourceFieldName"
                  ]
                }
              ]
            }
          },
          "required": ["fieldMappings"]
        },
        "meetingFile": {
          "type": "object",
          "properties": {
            "fieldMappings": {
              "type": "array",
              "items": [
                {
                  "type": "object",
                  "properties": {
                    "indexFieldName": {
                      "type": "string"
                    },
                    "indexFieldType": {
                      "type": "string",
                      "enum": ["STRING", "DATE", "LONG"]
                    },
                    "dataSourceFieldName": {
                      "type": "string"
                    },
                    "dateFieldFormat": {
                      "type": "string",
                      "pattern": "yyyy-MM-dd'T'HH:mm:ss'Z'"
                    }
                  },
                  "required": [
                    "indexFieldName",
                    "indexFieldType",
                    "dataSourceFieldName"
                  ]
                }
              ]
            }
          },
          "required": ["fieldMappings"]
        },
        "meetingNote": {
          "type": "object",
          "properties": {
            "fieldMappings": {
              "type": "array",
              "items": [
                {
                  "type": "object",
                  "properties": {
                    "indexFieldName": {
                      "type": "string"
                    },
                    "indexFieldType": {
                      "type": "string",
                      "enum": ["STRING", "DATE"]
                    },
                    "dataSourceFieldName": {
                      "type": "string"
                    },
                    "dateFieldFormat": {
                      "type": "string",
                      "pattern": "yyyy-MM-dd'T'HH:mm:ss'Z'"
                    }
                  },
                  "required": [
                    "indexFieldName",
                    "indexFieldType",
                    "dataSourceFieldName"
                  ]
                }
              ]
            }
          },
          "required": ["fieldMappings"]
        },
        "calendarMeeting": {
          "type": "object",
          "properties": {
            "fieldMappings": {
              "type": "array",
              "items": [
                {
                  "type": "object",
                  "properties": {
                    "indexFieldName": {
                      "type": "string"
                    },
                    "indexFieldType": {
                      "type": "string",
                      "enum": ["STRING", "DATE"]
                    },
                    "dataSourceFieldName": {
                      "type": "string"
                    },
                    "dateFieldFormat": {
                      "type": "string",
                      "pattern": "yyyy-MM-dd'T'HH:mm:ss'Z'"
                    }
                  },
                  "required": [
                    "indexFieldName",
                    "indexFieldType",
                    "dataSourceFieldName"
                  ]
                }
              ]
            }
          },
          "required": ["fieldMappings"]
        }
      }
    },
    "additionalProperties": {
      "type": "object",
      "properties": {
        "isCrawlAcl": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "string",
              "enum": ["true", "false"]
            }
          ]
        },
        "maxFileSizeInMegaBytes": {
          "type": "string"
        },
        "fieldForUserId": {
          "type": "string"
        },
        "paymentModel": {
          "type": "string",
          "enum": ["A", "B", "Evaluation Mode"]
        },
        "inclusionTeamNameFilter": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "exclusionTeamNameFilter": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "inclusionChannelNameFilter": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "exclusionChannelNameFilter": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "inclusionFileNamePatterns": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "exclusionFileNamePatterns": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "inclusionFileTypePatterns": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "exclusionFileTypePatterns": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "inclusionUserEmailFilter": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "isCrawlChatMessage": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "string",
              "enum": ["true", "false"]
            }
          ]
        },
        "isCrawlChatAttachment": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "string",
              "enum": ["true", "false"]
            }
          ]
        },
        "isCrawlChannelPost": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "string",
              "enum": ["true", "false"]
            }
          ]
        },
        "isCrawlChannelAttachment": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "string",
              "enum": ["true", "false"]
            }
          ]
        },
        "isCrawlChannelWiki": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "string",
              "enum": ["true", "false"]
            }
          ]
        },
        "isCrawlCalendarMeeting": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "string",
              "enum": ["true", "false"]
            }
          ]
        },
        "isCrawlMeetingChat": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "string",
              "enum": ["true", "false"]
            }
          ]
        },
        "isCrawlMeetingFile": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "string",
              "enum": ["true", "false"]
            }
          ]
        },
        "isCrawlMeetingNote": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "string",
              "enum": ["true", "false"]
            }
          ]
        },
        "startCalendarDateTime": {
          "anyOf": [
            {
              "type": "string",
              "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}Z$"
            },
            {
              "type": "string",
              "pattern": ""
            }
          ]
        },
        "endCalendarDateTime": {
          "anyOf": [
            {
              "type": "string",
              "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}Z$"
            },
            {
              "type": "string",
              "pattern": ""
            }
          ]
        },
        "enableDeletionProtection": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "string",
              "enum": ["true", "false"]
            }
          ],
          "default": false
        },
        "deletionProtectionThreshold": {
          "type": "string",
          "default": "15"
        }
      },
      "required": []
    },
    "version": {
      "type": "string",
      "anyOf": [
        {
          "pattern": "1.0.0"
        }
      ]
    },
    "required": [
      "type",
      "syncMode",
      "secretArn",
      "connectionConfiguration",
      "repositoryConfigurations",
      "additionalProperties"
    ]
  }
}
```

### Microsoft Teams JSON schema example for using the configuration property with AWS CloudFormation
<a name="teams-cfn-json-example"></a>

The following is the Microsoft Teams JSON schema example for the configuration property for CloudFormation

```
{
  "AWSTemplateFormatVersion": "2010-09-09",
  "Description": "CloudFormation MSTEAMS Data Source Template",
  "Resources": {
    "DataSourceMSTeams": {
      "Type": "AWS::QBusiness::DataSource",
      "Properties": {
        "ApplicationId": "app12345-1234-1234-1234-123456789012",
        "IndexId": "indx1234-1234-1234-1234-123456789012",
        "DisplayName": "MyMSTeamsDataSource",
        "RoleArn": "arn:aws:iam::123456789012:role/qbusiness-data-source-role",
        "Configuration": {
          "type": "MSTEAMS",
          "syncMode": "FULL_CRAWL",
          "secretArn": "arn:aws:secretsmanager:us-west-2:123456789012:secret:my-teams-secret",
          "enableIdentityCrawler": "true",
          "connectionConfiguration": {
            "repositoryEndpointMetadata": {
              "tenantId": "123e4567-e89b-12d3-a456-426614174000"
            }
          },
          "repositoryConfigurations": {
            "chatMessage": {
              "fieldMappings": [
                {
                  "indexFieldName": "message_id",
                  "indexFieldType": "STRING",
                  "dataSourceFieldName": "id",
                  "dateFieldFormat": "yyyy-MM-dd'T'HH:mm:ss'Z'"
                }
              ]
            },
            "chatAttachment": {
              "fieldMappings": [
                {
                  "indexFieldName": "attachment_id",
                  "indexFieldType": "STRING",
                  "dataSourceFieldName": "id",
                  "dateFieldFormat": "yyyy-MM-dd'T'HH:mm:ss'Z'"
                }
              ]
            },
            "channelPost": {
              "fieldMappings": [
                {
                  "indexFieldName": "post_id",
                  "indexFieldType": "STRING",
                  "dataSourceFieldName": "id",
                  "dateFieldFormat": "yyyy-MM-dd'T'HH:mm:ss'Z'"
                }
              ]
            },
            "channelWiki": {
              "fieldMappings": [
                {
                  "indexFieldName": "wiki_id",
                  "indexFieldType": "STRING",
                  "dataSourceFieldName": "id",
                  "dateFieldFormat": "yyyy-MM-dd'T'HH:mm:ss'Z'"
                }
              ]
            },
            "channelAttachment": {
              "fieldMappings": [
                {
                  "indexFieldName": "attachment_id",
                  "indexFieldType": "STRING",
                  "dataSourceFieldName": "id",
                  "dateFieldFormat": "yyyy-MM-dd'T'HH:mm:ss'Z'"
                }
              ]
            },
            "meetingChat": {
              "fieldMappings": [
                {
                  "indexFieldName": "meeting_chat_id",
                  "indexFieldType": "STRING",
                  "dataSourceFieldName": "id",
                  "dateFieldFormat": "yyyy-MM-dd'T'HH:mm:ss'Z'"
                }
              ]
            },
            "meetingFile": {
              "fieldMappings": [
                {
                  "indexFieldName": "meeting_file_id",
                  "indexFieldType": "STRING",
                  "dataSourceFieldName": "id",
                  "dateFieldFormat": "yyyy-MM-dd'T'HH:mm:ss'Z'"
                }
              ]
            },
            "meetingNote": {
              "fieldMappings": [
                {
                  "indexFieldName": "meeting_note_id",
                  "indexFieldType": "STRING",
                  "dataSourceFieldName": "id",
                  "dateFieldFormat": "yyyy-MM-dd'T'HH:mm:ss'Z'"
                }
              ]
            },
            "calendarMeeting": {
              "fieldMappings": [
                {
                  "indexFieldName": "calendar_meeting_id",
                  "indexFieldType": "STRING",
                  "dataSourceFieldName": "id",
                  "dateFieldFormat": "yyyy-MM-dd'T'HH:mm:ss'Z'"
                }
              ]
            }
          },
          "additionalProperties": {
            "isCrawlAcl": "true",
            "maxFileSizeInMegaBytes": "50",
            "fieldForUserId": "user_id",
            "paymentModel": "A",
            "inclusionTeamNameFilter": ["TeamA", "TeamB"],
            "exclusionTeamNameFilter": ["TeamC"],
            "inclusionChannelNameFilter": ["Channel1", "Channel2"],
            "exclusionChannelNameFilter": ["Channel3"],
            "inclusionFileNamePatterns": ["*.docx", "*.pdf"],
            "exclusionFileNamePatterns": ["*.tmp"],
            "inclusionFileTypePatterns": ["image/png", "image/jpeg"],
            "exclusionFileTypePatterns": ["application/octet-stream"],
            "inclusionUserEmailFilter": ["user@example.com"],
            "isCrawlChatMessage": "true",
            "isCrawlChatAttachment": "true",
            "isCrawlChannelPost": "true",
            "isCrawlChannelAttachment": "true",
            "isCrawlChannelWiki": "true",
            "isCrawlCalendarMeeting": "true",
            "isCrawlMeetingChat": "true",
            "isCrawlMeetingFile": "true",
            "isCrawlMeetingNote": "true",
            "startCalendarDateTime": "2023-01-01T00:00:00Z",
            "endCalendarDateTime": "2023-12-31T23:59:59Z",
            "enableDeletionProtection": "false",
            "deletionProtectionThreshold": "15"
          }
        }
      }
    }
  }
}
```

## Microsoft Teams YAML schema for using the configuration property with AWS CloudFormation
<a name="teams-cfn-yaml"></a>

The following is the Microsoft Teams YAML schema and examples for the configuration property for AWS CloudFormation:

**Topics**
+ [Microsoft Teams YAML schema for using the configuration property with AWS CloudFormation](#teams-cfn-yaml-schema)
+ [Microsoft Teams YAML schema example for using the configuration property with AWS CloudFormation](#teams-cfn-yaml-example)

### Microsoft Teams YAML schema for using the configuration property with AWS CloudFormation
<a name="teams-cfn-yaml-schema"></a>

The following is the Microsoft Teams YAML schema for the configuration property for CloudFormation.

```
type: object
properties:
  type:
    type: string
    pattern: MSTEAMS
  syncMode:
    type: string
    enum:
      - FORCED_FULL_CRAWL
      - FULL_CRAWL
      - CHANGE_LOG
  secretArn:
    type: string
    minLength: 20
    maxLength: 2048
  enableIdentityCrawler:
    anyOf:
      - type: boolean
      - type: string
        enum:
          - "true"
          - "false"
  connectionConfiguration:
    type: object
    properties:
      repositoryEndpointMetadata:
        type: object
        properties:
          tenantId:
            type: string
            pattern: "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
            minLength: 36
            maxLength: 36
        required:
          - tenantId
    required:
      - repositoryEndpointMetadata
  repositoryConfigurations:
    type: object
    properties:
      chatMessage:
        type: object
        properties:
          fieldMappings:
            type: array
            items:
              type: object
              properties:
                indexFieldName:
                  type: string
                indexFieldType:
                  type: string
                  enum:
                    - STRING
                    - STRING_LIST
                    - DATE
                dataSourceFieldName:
                  type: string
                dateFieldFormat:
                  type: string
                  pattern: "yyyy-MM-dd'T'HH:mm:ss'Z'"
              required:
                - indexFieldName
                - indexFieldType
                - dataSourceFieldName
        required:
          - fieldMappings
      chatAttachment:
        type: object
        properties:
          fieldMappings:
            type: array
            items:
              type: object
              properties:
                indexFieldName:
                  type: string
                indexFieldType:
                  type: string
                  enum:
                    - STRING
                    - DATE
                    - LONG
                dataSourceFieldName:
                  type: string
                dateFieldFormat:
                  type: string
                  pattern: "yyyy-MM-dd'T'HH:mm:ss'Z'"
              required:
                - indexFieldName
                - indexFieldType
                - dataSourceFieldName
        required:
          - fieldMappings
      channelPost:
        type: object
        properties:
          fieldMappings:
            type: array
            items:
              type: object
              properties:
                indexFieldName:
                  type: string
                indexFieldType:
                  type: string
                  enum:
                    - STRING
                    - STRING_LIST
                    - DATE
                dataSourceFieldName:
                  type: string
                dateFieldFormat:
                  type: string
                  pattern: "yyyy-MM-dd'T'HH:mm:ss'Z'"
              required:
                - indexFieldName
                - indexFieldType
                - dataSourceFieldName
        required:
          - fieldMappings
      channelWiki:
        type: object
        properties:
          fieldMappings:
            type: array
            items:
              type: object
              properties:
                indexFieldName:
                  type: string
                indexFieldType:
                  type: string
                  enum:
                    - STRING
                    - DATE
                    - LONG
                dataSourceFieldName:
                  type: string
                dateFieldFormat:
                  type: string
                  pattern: "yyyy-MM-dd'T'HH:mm:ss'Z'"
              required:
                - indexFieldName
                - indexFieldType
                - dataSourceFieldName
        required:
          - fieldMappings
      channelAttachment:
        type: object
        properties:
          fieldMappings:
            type: array
            items:
              type: object
              properties:
                indexFieldName:
                  type: string
                indexFieldType:
                  type: string
                  enum:
                    - STRING
                    - DATE
                    - LONG
                dataSourceFieldName:
                  type: string
                dateFieldFormat:
                  type: string
                  pattern: "yyyy-MM-dd'T'HH:mm:ss'Z'"
              required:
                - indexFieldName
                - indexFieldType
                - dataSourceFieldName
        required:
          - fieldMappings
      meetingChat:
        type: object
        properties:
          fieldMappings:
            type: array
            items:
              type: object
              properties:
                indexFieldName:
                  type: string
                indexFieldType:
                  type: string
                  enum:
                    - STRING
                    - STRING_LIST
                    - DATE
                dataSourceFieldName:
                  type: string
                dateFieldFormat:
                  type: string
                  pattern: "yyyy-MM-dd'T'HH:mm:ss'Z'"
              required:
                - indexFieldName
                - indexFieldType
                - dataSourceFieldName
        required:
          - fieldMappings
      meetingFile:
        type: object
        properties:
          fieldMappings:
            type: array
            items:
              type: object
              properties:
                indexFieldName:
                  type: string
                indexFieldType:
                  type: string
                  enum:
                    - STRING
                    - DATE
                    - LONG
                dataSourceFieldName:
                  type: string
                dateFieldFormat:
                  type: string
                  pattern: "yyyy-MM-dd'T'HH:mm:ss'Z'"
              required:
                - indexFieldName
                - indexFieldType
                - dataSourceFieldName
        required:
          - fieldMappings
      meetingNote:
        type: object
        properties:
          fieldMappings:
            type: array
            items:
              type: object
              properties:
                indexFieldName:
                  type: string
                indexFieldType:
                  type: string
                  enum:
                    - STRING
                    - DATE
                dataSourceFieldName:
                  type: string
                dateFieldFormat:
                  type: string
                  pattern: "yyyy-MM-dd'T'HH:mm:ss'Z'"
              required:
                - indexFieldName
                - indexFieldType
                - dataSourceFieldName
        required:
          - fieldMappings
      calendarMeeting:
        type: object
        properties:
          fieldMappings:
            type: array
            items:
              type: object
              properties:
                indexFieldName:
                  type: string
                indexFieldType:
                  type: string
                  enum:
                    - STRING
                    - DATE
                dataSourceFieldName:
                  type: string
                dateFieldFormat:
                  type: string
                  pattern: "yyyy-MM-dd'T'HH:mm:ss'Z'"
              required:
                - indexFieldName
                - indexFieldType
                - dataSourceFieldName
        required:
          - fieldMappings
  additionalProperties:
    type: object
    properties:
      isCrawlAcl:
        anyOf:
          - type: boolean
          - type: string
            enum:
              - "true"
              - "false"
      maxFileSizeInMegaBytes:
        type: string
      fieldForUserId:
        type: string
      paymentModel:
        type: string
        enum:
          - A
          - B
          - Evaluation Mode
      inclusionTeamNameFilter:
        type: array
        items:
          type: string
      exclusionTeamNameFilter:
        type: array
        items:
          type: string
      inclusionChannelNameFilter:
        type: array
        items:
          type: string
      exclusionChannelNameFilter:
        type: array
        items:
          type: string
      inclusionFileNamePatterns:
        type: array
        items:
          type: string
      exclusionFileNamePatterns:
        type: array
        items:
          type: string
      inclusionFileTypePatterns:
        type: array
        items:
          type: string
      exclusionFileTypePatterns:
        type: array
        items:
          type: string
      inclusionUserEmailFilter:
        type: array
        items:
          type: string
      isCrawlChatMessage:
        anyOf:
          - type: boolean
          - type: string
            enum:
              - "true"
              - "false"
      isCrawlChatAttachment:
        anyOf:
          - type: boolean
          - type: string
            enum:
              - "true"
              - "false"
      isCrawlChannelPost:
        anyOf:
          - type: boolean
          - type: string
            enum:
              - "true"
              - "false"
      isCrawlChannelAttachment:
        anyOf:
          - type: boolean
          - type: string
            enum:
              - "true"
              - "false"
      isCrawlChannelWiki:
        anyOf:
          - type: boolean
          - type: string
            enum:
              - "true"
              - "false"
      isCrawlCalendarMeeting:
        anyOf:
          - type: boolean
          - type: string
            enum:
              - "true"
              - "false"
      isCrawlMeetingChat:
        anyOf:
          - type: boolean
          - type: string
            enum:
              - "true"
              - "false"
      isCrawlMeetingFile:
        anyOf:
          - type: boolean
          - type: string
            enum:
              - "true"
              - "false"
      isCrawlMeetingNote:
        anyOf:
          - type: boolean
          - type: string
            enum:
              - "true"
              - "false"
      startCalendarDateTime:
        anyOf:
          - type: string
            pattern: "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}Z$"
          - type: string
            pattern: ""
      endCalendarDateTime:
        anyOf:
          - type: string
            pattern: "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}Z$"
          - type: string
            pattern: ""
      enableDeletionProtection:
        anyOf:
          - type: boolean
          - type: string
            enum:
              - "true"
              - "false"
        default: false
      deletionProtectionThreshold:
        type: string
        default: "15"
    required: []
  version:
    type: string
    anyOf:
      - pattern: "1.0.0"
  required:
    - connectionConfiguration
    - repositoryConfigurations
    - syncMode
    - additionalProperties
    - secretArn
    - type
```

### Microsoft Teams YAML schema example for using the configuration property with AWS CloudFormation
<a name="teams-cfn-yaml-example"></a>

The following is the Microsoft Teams YAML example for the Configuration property for CloudFormation:

```
AWSTemplateFormatVersion: "2010-09-09"
Description: CloudFormation MSTEAMS Data Source Template
Resources:
  DataSourceMSTeams:
    Type: AWS::QBusiness::DataSource
    Properties:
      ApplicationId: app12345-1234-1234-1234-123456789012
      IndexId: indx1234-1234-1234-1234-123456789012
      DisplayName: MyMSTeamsDataSource
      RoleArn: arn:aws:iam::123456789012:role/qbusiness-data-source-role
      Configuration:
        type: MSTEAMS
        syncMode: FULL_CRAWL
        secretArn: arn:aws:secretsmanager:us-west-2:123456789012:secret:my-teams-secret
        enableIdentityCrawler: "true"
        connectionConfiguration:
          repositoryEndpointMetadata:
            tenantId: 123e4567-e89b-12d3-a456-426614174000
        repositoryConfigurations:
          chatMessage:
            fieldMappings:
              - indexFieldName: message_id
                indexFieldType: STRING
                dataSourceFieldName: id
                dateFieldFormat: yyyy-MM-dd'T'HH:mm:ss'Z'
          chatAttachment:
            fieldMappings:
              - indexFieldName: attachment_id
                indexFieldType: STRING
                dataSourceFieldName: id
                dateFieldFormat: yyyy-MM-dd'T'HH:mm:ss'Z'
          channelPost:
            fieldMappings:
              - indexFieldName: post_id
                indexFieldType: STRING
                dataSourceFieldName: id
                dateFieldFormat: yyyy-MM-dd'T'HH:mm:ss'Z'
          channelWiki:
            fieldMappings:
              - indexFieldName: wiki_id
                indexFieldType: STRING
                dataSourceFieldName: id
                dateFieldFormat: yyyy-MM-dd'T'HH:mm:ss'Z'
          channelAttachment:
            fieldMappings:
              - indexFieldName: attachment_id
                indexFieldType: STRING
                dataSourceFieldName: id
                dateFieldFormat: yyyy-MM-dd'T'HH:mm:ss'Z'
          meetingChat:
            fieldMappings:
              - indexFieldName: meeting_chat_id
                indexFieldType: STRING
                dataSourceFieldName: id
                dateFieldFormat: yyyy-MM-dd'T'HH:mm:ss'Z'
          meetingFile:
            fieldMappings:
              - indexFieldName: meeting_file_id
                indexFieldType: STRING
                dataSourceFieldName: id
                dateFieldFormat: yyyy-MM-dd'T'HH:mm:ss'Z'
          meetingNote:
            fieldMappings:
              - indexFieldName: meeting_note_id
                indexFieldType: STRING
                dataSourceFieldName: id
                dateFieldFormat: yyyy-MM-dd'T'HH:mm:ss'Z'
          calendarMeeting:
            fieldMappings:
              - indexFieldName: calendar_meeting_id
                indexFieldType: STRING
                dataSourceFieldName: id
                dateFieldFormat: yyyy-MM-dd'T'HH:mm:ss'Z'
        additionalProperties:
          isCrawlAcl: "true"
          maxFileSizeInMegaBytes: "50"
          fieldForUserId: user_id
          paymentModel: A
          inclusionTeamNameFilter:
            - TeamA
            - TeamB
          exclusionTeamNameFilter:
            - TeamC
          inclusionChannelNameFilter:
            - Channel1
            - Channel2
          exclusionChannelNameFilter:
            - Channel3
          inclusionFileNamePatterns:
            - "*.docx"
            - "*.pdf"
          exclusionFileNamePatterns:
            - "*.tmp"
          inclusionFileTypePatterns:
            - image/png
            - image/jpeg
          exclusionFileTypePatterns:
            - application/octet-stream
          inclusionUserEmailFilter:
            - user@example.com
          isCrawlChatMessage: "true"
          isCrawlChatAttachment: "true"
          isCrawlChannelPost: "true"
          isCrawlChannelAttachment: "true"
          isCrawlChannelWiki: "true"
          isCrawlCalendarMeeting: "true"
          isCrawlMeetingChat: "true"
          isCrawlMeetingFile: "true"
          isCrawlMeetingNote: "true"
          startCalendarDateTime: "2023-01-01T00:00:00Z"
          endCalendarDateTime: "2023-12-31T23:59:59Z"
          enableDeletionProtection: "false"
          deletionProtectionThreshold: "15"
```

**Note**  
ACL crawling is available for both new and original Microsoft Teams connector versions.

# How Amazon Q Business connector crawls Microsoft Teams ACLs
<a name="teams-user-management"></a>

Connectors support crawling ACL and identity information where applicable based on the data source. If you index documents without ACLs, all documents are considered public. Indexing documents with ACLs ensures data security.

Amazon Q Business supports crawling ACLs for document security by default.

Microsoft Teams content is categorized into Chats, Channels, and Calendar. Chats support one-on-one and group conversations with attachments, which can be filtered using email domains or regex rules. Channels are structured within Microsoft Teams and can be Standard (open to all team members), Shared (accessible to team members and invited external users), or Private (restricted to specific members). Calendars facilitate meeting scheduling and management, supporting attachments and OneNote tabs.

When you connect a Microsoft Teams data source to Amazon Q Business, Amazon Q Business makes a copy of these resources and creates an index that can be used to respond to user prompts and queries. Additionally, the connector crawls ACL information attached to a document (user and group information) from your Microsoft Teams instance. If you choose to activate ACL crawling, the information can be used to filter chat responses to your end user's document access level.

**Identity Crawling**: Amazon Q Business synchronizes both local and federated users/groups. Federated groups are synced outside Amazon Q, and their memberships are not stored. Identities are canonicalized by converting all letters to lowercase to prevent duplication issues, meaning "TestUser" and "testuser" are treated as the same. When a user is deleted, their permissions are not inherited by a newly created user with the same name, ensuring secure access management. Once a user is marked as disabled in Microsoft Teams, after the next sync users will no longer have access to search or retrieve previously crawled data, including calendar meetings.

Users can configure the connector to include filters for channel posts and attachments. Team and Channel name can be included and excluded. Also, we can add regular expression to include and exclude filters for attachments. Private channels are restricted to specific members within a team. Shared and private channels have their own ACLs, enabling more granular permission management.

**Permission Inheritance**: Chats, Channels and Calendar inherit permissions from the root or the group while attachments inherit from their parent entity (chat, channel, or calendar event).

**Change Management**: Change Log Mode in Amazon Q Business enables incremental updates by capturing modifications made to content in Microsoft Teams. Instead of re-indexing all documents, it indexes only newly added, updated, or deleted items since the last crawl. Any changes to user or group access permissions are also recorded, ensuring accurate and up-to-date indexing.

**Failure handling**: The connector follows a fail-close approach, meaning if there are permission-related issues or API failures, affected documents are skipped from ingestion rather than being made publicly accessible. This prevents unauthorized access while maintaining data integrity.

For more information, see:
+ [Authorization](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/connector-concepts.html#connector-authorization)
+ [Identity crawler](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/connector-concepts.html#connector-identity-crawler)
+ [Understanding User Store](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/connector-principal-store.html)

**Note**  
Field mappings are available for the original Microsoft Teams connector only. The new connector uses automatic field mapping.

# Microsoft Teams data source connector field mappings
<a name="teams-field-mappings"></a>

To help you structure data for retrieval and chat filtering, Amazon Q Business crawls data source document attributes or metadata and maps them to fields in your Amazon Q index.

Amazon Q has reserved fields that it uses when querying your application. When possible, Amazon Q automatically maps these built-in fields to attributes in your data source. If a built-in field doesn't have a default mapping, or if you want to map additional index fields, use the custom field mappings to specify how a data source attribute maps to your Amazon Q application. You create field mappings by editing your data source after your application and retriever are created.

To learn more about document attributes and how they work in Amazon Q, see [Document attributes and types in Amazon Q](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/doc-attributes.html).

**Important**  
Filtering using document attributes in chat is only supported through the API.

The Amazon Q Teams connector supports the following entities and the associated reserved and custom attributes.

**Note**  
You can map any Teams field to the document title or document body Amazon Q reserved/default index fields.

**Topics**
+ [Chat messages](#teams-field-mappings-chat-messages)
+ [Chat attachments](#teams-field-mappings-chat-attachments)
+ [Channel posts](#teams-field-mappings-channel-posts)
+ [Channel file attachments](#teams-field-mappings-channel-file-attachments)
+ [Wiki](#teams-field-mappings-wiki)
+ [Meeting chats](#teams-field-mappings-meeting-chats)
+ [Meeting details](#teams-field-mappings-meeting-details)
+ [Meeting notes](#teams-field-mappings-meeting-notes)
+ [Meeting files](#teams-field-mappings-meeting-files)

## Chat messages
<a name="teams-field-mappings-chat-messages"></a>


| Microsoft Teams field name | Index field name | Description | Data type | 
| --- | --- | --- | --- | 
|  subject  |  tms\$1subject  |  Custom  |  String  | 
|  summary  |  tms\$1summary  |  Custom  |  String  | 
|  importance  |  tms\$1importance  |  Custom  |  String  | 
|  messageType  |  tms\$1message\$1type  |  Custom  |  String  | 
|  sender  |  tms\$1sender  |  Custom  |  String  | 
|  sourceUrl  |  \$1source\$1uri  |  Default  |  String  | 
|  attachments  |  tms\$1attachments  |  Custom  |  String list  | 
|  reactions  |  tms\$1reactions  |  Custom  |  String list  | 
|  mentions  |  tms\$1mentions  |  Custom  |  String list  | 
|  deletedAt  |  tms\$1last\$1deleted\$1at  |  Custom  |  Date  | 
|  createdAt  |  \$1created\$1at  |  Default  |  Date  | 
|  lastModifiedAt  |  \$1last\$1updated\$1at  |  Default  |  Date  | 

## Chat attachments
<a name="teams-field-mappings-chat-attachments"></a>


| Microsoft Teams field name | Index field name | Description | Data type | 
| --- | --- | --- | --- | 
|  fileName  |  tms\$1name  |  Custom  |  String  | 
|  size  |  tms\$1file\$1size  |  Custom  |  Long (numeric)  | 
|  title  |  tms\$1title  |  Custom  |  String  | 
|  sourceUrl  |  \$1source\$1uri  |  Default  |  String  | 
|  lastModifiedBy  |  tms\$1last\$1modified\$1by  |  Custom  |  String  | 
|  createdBy  |  tms\$1created\$1by  |  Custom  |  String  | 
|  createdAt  |  \$1created\$1at  |  Default  |  Date  | 
|  lastModifiedAt  |  \$1last\$1updated\$1at  |  Default  |  Date  | 

## Channel posts
<a name="teams-field-mappings-channel-posts"></a>


| Microsoft Teams field name | Index field name | Description | Data type | 
| --- | --- | --- | --- | 
|  subject  |  tms\$1subject  |  Custom  |  String  | 
|  summary  |  tms\$1summary  |  Custom  |  String  | 
|  importance  |  tms\$1importance  |  Custom  |  String  | 
|  messageType  |  tms\$1message\$1type  |  Custom  |  String  | 
|  createdBy  |  tms\$1created\$1by  |  Custom  |  String  | 
|  deletedAt  |  tms\$1last\$1deleted\$1at  |  Custom  |  Date  | 
|  sourceUrl  |  \$1source\$1uri  |  Default  |  String  | 
|  mentions  |  tms\$1mentions  |  Custom  |  String list  | 
|  reactions  |  tms\$1reactions  |  Custom  |  String list  | 
|  attachments  |  tms\$1attachments  |  Custom  |  String list  | 
|  createdAt  |  \$1created\$1at  |  Default  |  Date  | 
|  lastModifiedAt  |  \$1last\$1updated\$1at  |  Default  |  Date  | 

## Channel file attachments
<a name="teams-field-mappings-channel-file-attachments"></a>


| Microsoft Teams field name | Index field name | Description | Data type | 
| --- | --- | --- | --- | 
|  fileName  |  tms\$1name  |  Custom  |  String  | 
|  size  |  tms\$1file\$1size  |  Custom  |  Long (numeric)  | 
|  channelName  |  tms\$1channel\$1name  |  Custom  |  String  | 
|  Title  |  tms\$1title  |  Custom  |  String  | 
|  sourceUrl  |  \$1source\$1uri  |  Default  |  String  | 
|  createdBy  |  tms\$1created\$1by  |  Custom  |  String  | 
|  lastModifiedBy  |  tms\$1last\$1modified\$1by  |  Custom  |  String  | 
|  createdAt  |  \$1created\$1at  |  Default  |  Date  | 
|  lastModifiedAt  |  \$1last\$1updated\$1at  |  Default  |  Date  | 
|  oneNoteDocument  |  tms\$1onenote\$1document  |  Custom  |  String  | 
|  oneNoteSection  |  tms\$1onenote\$1section  |  Custom  |  String  | 
|  oneNotePage  |  tms\$1onenote\$1page  |  Custom  |  String  | 

## Wiki
<a name="teams-field-mappings-wiki"></a>


| Microsoft Teams field name | Index field name | Description | Data type | 
| --- | --- | --- | --- | 
|  channelName  |  tms\$1channel\$1name  |  Custom  |  String  | 
|  fileName  |  tms\$1name  |  Custom  |  String  | 
|  size  |  tms\$1file\$1size  |  Custom  |  Long (numeric)  | 
|  createdBy  |  tms\$1created\$1by  |  Custom  |  String  | 
|  lastModifiedBy  |  tms\$1last\$1modified\$1by  |  Custom  |  String  | 
|  title  |  tms\$1title  |  Custom  |  String  | 
|  sourceUrl  |  \$1source\$1uri  |  Default  |  String  | 
|  createdAt  |  \$1created\$1at  |  Default  |  Date  | 
|  lastModifiedAt  |  \$1last\$1updated\$1at  |  Default  |  Date  | 

## Meeting chats
<a name="teams-field-mappings-meeting-chats"></a>


| Microsoft Teams field name | Index field name | Description | Data type | 
| --- | --- | --- | --- | 
|  subject  |  tms\$1subject  |  Custom  |  String  | 
|  summary  |  tms\$1summary  |  Custom  |  String  | 
|  importance  |  tms\$1importance  |  Custom  |  String  | 
|  messageType  |  tms\$1message\$1type  |  Custom  |  String  | 
|  Sender  |  tms\$1sender  |  Custom  |  String  | 
|  attachments  |  tms\$1attachments  |  Custom  |  String list  | 
|  mentions  |  tms\$1mentions  |  Custom  |  String list  | 
|  reactions  |  tms\$1reactions  |  Custom  |  String list  | 
|  sourceUrl  |  \$1source\$1uri  |  Default  |  String  | 
|  deletedAt  |  tms\$1last\$1deleted\$1at  |  Custom  |  Date  | 
|  createdAt  |  \$1created\$1at  |  Default  |  Date  | 
|  lastModifiedAt  |  \$1last\$1updated\$1at  |  Default  |  Date  | 

## Meeting details
<a name="teams-field-mappings-meeting-details"></a>


| Microsoft Teams field name | Index field name | Description | Data type | 
| --- | --- | --- | --- | 
|  subject  |  tms\$1subject  |  Custom  |  String  | 
|  summary  |  tms\$1summary  |  Custom  |  String  | 
|  importance  |  tms\$1importance  |  Custom  |  String  | 
|  username  |  tms\$1from\$1user  |  Custom  |  String  | 
|  eventStartTime  |  tms\$1event\$1start\$1time  |  Custom  |  Date  | 
|  eventEndTime  |  tms\$1event\$1end\$1time  |  Custom  |  Date  | 
|  sourceURL  |  \$1source\$1uri  |  Default  |  String  | 

## Meeting notes
<a name="teams-field-mappings-meeting-notes"></a>


| Microsoft Teams field name | Index field name | Description | Data type | 
| --- | --- | --- | --- | 
|  fileName  |  tms\$1name  |  Custom  |  String  | 
|  title  |  tms\$1title  |  Custom  |  String  | 
|  createdBy  |  tms\$1created\$1by  |  Custom  |  String  | 
|  lastModifiedBy  |  tms\$1last\$1modified\$1by  |  Custom  |  String  | 
|  sourceUrl  |  \$1source\$1uri  |  Default  |  String  | 
|  createdAt  |  \$1created\$1at  |  Default  |  Date  | 
|  lastModifiedAt  |  \$1last\$1updated\$1at  |  Default  |  Date  | 

## Meeting files
<a name="teams-field-mappings-meeting-files"></a>


| Microsoft Teams field name | Index field name | Description | Data type | 
| --- | --- | --- | --- | 
|  fileName  |  tms\$1name  |  Custom  |  String  | 
|  title  |  tms\$1title  |  Custom  |  String  | 
|  size  |  tms\$1file\$1size  |  Custom  |  Long (numeric)  | 
|  sourceUrl  |  \$1source\$1uri  |  Default  |  String  | 
|  createdBy  |  tms\$1created\$1by  |  Custom  |  String  | 
|  lastModifiedBy  |  tms\$1last\$1modified\$1by  |  Custom  |  String  | 
|  createdAt  |  \$1created\$1at  |  Default  |  Date  | 
|  lastModifiedAt  |  \$1last\$1updated\$1at  |  Default  |  Date  | 

# IAM role for Microsoft Teams connector
<a name="teams-iam-role"></a>

**Note**  
This section applies to both new and original Microsoft Teams connector versions.

If you use the AWS CLI or an AWS SDK, you must create an AWS Identity and Access Management (IAM) policy before you create an Amazon Q resource. When you call the [CreateDataSource](https://docs.aws.amazon.com/amazonq/latest/api-reference/API_CreateDataSource.html) operation, you provide the Amazon Resource Name (ARN) role with the policy attached.

If you use the AWS Management Console, you can create a new IAM role in the Amazon Q console or use an existing IAM role.

To learn more about IAM roles, see [IAM roles](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles.html) in the *AWS Identity and Access Management User Guide*.

To connect your data source connector to Amazon Q, you must give Amazon Q an IAM role that has the following permissions:
+ Permission to access the `BatchPutDocument` and `BatchDeleteDocument` operations to ingest documents.
+ Permission to access the [User Store](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/connector-principal-store.html) API operations to ingest user and group access control information from documents.
+ Permission to access your AWS Secrets Manager secret to authenticate your data source connector instance.
+ **(Optional)** If you're using Amazon VPC, permission to access your Amazon VPC.

```
{
  "Version": "2012-10-17",		 	 	 ,
  "Statement": [
    {
      "Sid": "AllowsAmazonQToGetSecret",
      "Effect": "Allow",
      "Action": [
        "secretsmanager:GetSecretValue"
      ],
      "Resource": [
        "arn:aws:secretsmanager:{{region}}:{{account_id}}:secret:[[secret_id]]"
      ]
    },
    {
      "Sid": "AllowsAmazonQToDecryptSecret",
      "Effect": "Allow",
      "Action": [
        "kms:Decrypt"
      ],
      "Resource": [
        "arn:aws:kms:{{region}}:{{account_id}}:key/[[key_id]]"
      ],
      "Condition": {
        "StringLike": {
          "kms:ViaService": [
            "secretsmanager.*.amazonaws.com"
          ]
        }
      }
    },
    {
      "Sid": "AllowsAmazonQToIngestDocuments",
      "Effect": "Allow",
      "Action": [
        "qbusiness:BatchPutDocument",
        "qbusiness:BatchDeleteDocument"
      ],
      "Resource": [
      "arn:aws:qbusiness:{{region}}:{{source_account}}:application/{{application_id}}",
      "arn:aws:qbusiness:{{region}}:{{source_account}}:application/{{application_id}}/index/{{index_id}}"
      ]
    },
    {
      "Sid": "AllowsAmazonQToIngestPrincipalMapping",
      "Effect": "Allow",
      "Action": [
        "qbusiness:PutGroup",
        "qbusiness:CreateUser",
        "qbusiness:DeleteGroup",
        "qbusiness:UpdateUser",
        "qbusiness:ListGroups"
      ],
      "Resource": [
        "arn:aws:qbusiness:{{region}}:{{account_id}}:application/{{application_id}}",
        "arn:aws:qbusiness:{{region}}:{{account_id}}:application/{{application_id}}/index/{{index_id}}",
        "arn:aws:qbusiness:{{region}}:{{account_id}}:application/{{application_id}}/index/{{index_id}}/data-source/*"
      ]
    },
    {
      "Sid": "AllowsAmazonQToCreateAndDeleteNI",
      "Effect": "Allow",
      "Action": [
        "ec2:CreateNetworkInterface",
        "ec2:DeleteNetworkInterface"
      ],
      "Resource": [
        "arn:aws:ec2:{{region}}:{{account_id}}:subnet/[[subnet_ids]]",
        "arn:aws:ec2:{{region}}:{{account_id}}:security-group/[[security_group]]"
      ]
    },
    {
      "Sid": "AllowsAmazonQToCreateAndDeleteNIForSpecificTag",
      "Effect": "Allow",
      "Action": [
        "ec2:CreateNetworkInterface",
        "ec2:DeleteNetworkInterface"
      ],
      "Resource": "arn:aws:ec2:{{region}}:{{account_id}}:network-interface/*",
      "Condition": {
        "StringLike": {
          "aws:RequestTag/AMAZON_Q": "qbusiness_{{account_id}}_{{application_id}}_*"
        },
        "ForAllValues:StringEquals": {
          "aws:TagKeys": [
            "AMAZON_Q"
          ]
        }
      }
    },
    {
      "Sid": "AllowsAmazonQToCreateTags",
      "Effect": "Allow",
      "Action": [
        "ec2:CreateTags"
      ],
      "Resource": "arn:aws:ec2:{{region}}:{{account_id}}:network-interface/*",
      "Condition": {
        "StringEquals": {
          "ec2:CreateAction": "CreateNetworkInterface"
        }
      }
    },
    {
      "Sid": "AllowsAmazonQToCreateNetworkInterfacePermission",
      "Effect": "Allow",
      "Action": [
        "ec2:CreateNetworkInterfacePermission"
      ],
      "Resource": "arn:aws:ec2:{{region}}:{{account_id}}:network-interface/*",
      "Condition": {
        "StringLike": {
          "aws:ResourceTag/AMAZON_Q": "qbusiness_{{account_id}}_{{application_id}}_*"
        }
      }
    },
   {
      "Sid": "AllowsAmazonQToDescribeResourcesForVPC",
      "Effect": "Allow",
      "Action": [
        "ec2:DescribeNetworkInterfaces",
        "ec2:DescribeAvailabilityZones",
        "ec2:DescribeNetworkInterfaceAttribute",
        "ec2:DescribeVpcs",
        "ec2:DescribeRegions",
        "ec2:DescribeNetworkInterfacePermissions",
        "ec2:DescribeSubnets"
      ],
      "Resource": "*"
    }
  ]
}
```

**To allow Amazon Q to assume a role, you must also use the following trust policy:**

```
{
  "Version": "2012-10-17",		 	 	 ,
  "Statement": [
    {
      "Sid": "AllowsAmazonQServicePrincipal",
      "Effect": "Allow",
      "Principal": {
        "Service": "qbusiness.amazonaws.com"
      },
      "Action": "sts:AssumeRole",
      "Condition": {
        "StringEquals": {
          "aws:SourceAccount": "{{source_account}}"
        },
        "ArnEquals": {
          "aws:SourceArn": "arn:aws:qbusiness:{{region}}:{{source_account}}:application/{{application_id}}"
        }
      }
    }
  ]
}
```

For more information on Amazon Q data source connector IAM roles, see [IAM roles for Amazon Q data source connectors](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/iam-roles.html#iam-roles-ds).

# Troubleshooting your Microsoft Teams connector
<a name="teams-troubleshooting"></a>

The following table provides information about error codes you might see for the Microsoft Teams connector and suggested troubleshooting actions.


| Error code | Error message | Suggested resolution | 
| --- | --- | --- | 
| MST-5001 | Exception occurred while sending request to MSTeams api, please try again later. | Error related to authentication. Check logs for the specific error message. | 
| MST-5101 | Exception occurred while validating configuration. | Error related to configurations. Check logs for the specific error message. | 
| MST-5102 | ClientID cannot be null in Repository configuration. | Error related to configurations. Check logs for the specific error message. | 
| MST-5103 | TenantId cannot be null in Repository configuration. | Error related to configurations. Check logs for the specific error message. | 
| MST-5104 | ClientSecret cannot be null in Repository configuration | Error related to configurations. Check logs for the specific error message. | 
| MST-5105 | Please add a valid paymentModel under additionalProperties. The paymentModel should be one of the following. | Error related to configurations. Check logs for the specific error message. | 
| MST-5106 | Please add valid startCalendarDateTime & endCalendarDateTime under additionalProperties: startCalendarDateTime & endCalendarDateTime should be in this format 2016-12-01T00:00:00Z. | Error related to configurations. Please check logs for the specific error message. | 
| MST-5107 | isCrawlChatMessage should be true or false. | Error related to configurations. Please check logs for the specific error message. | 
| MST-5108 | isCrawlMeetingChatValue should be true or false. | Error related to configurations. Please check logs for the specific error message. | 
| MST-5109 | isCrawlChatAttachment should be true or false. | Error related to configurations. Please check logs for the specific error message. | 
| MST-5110 | isCrawlMeetingFile should be true or false. | Error related to configurations. Please check logs for the specific error message. | 
| MST-5111 | isCrawlMeetingNote should be true or false. | Error related to configurations. Please check logs for the specific error message. | 
| MST-5112 | isCrawlChannelPost should be true or false. | Error related to configurations. Please check logs for the specific error message. | 
| MST-5113 | isCrawlChannelAttachment should be true or false | Error related to configurations. Please check logs for the specific error message. | 
| MST-5114 | isCrawlChannelWiki should be true or false. | Error related to configurations. Please check logs for the specific error message. | 
| MST-5115 | isCrawlCalendarMeeting should be true or false. | Error related to configurations. Please check logs for the specific error message. | 
| MST-5116 | Invalid clientId pattern. | Error related to configurations. Please check logs for the specific error message.. | 
| MST-5117 | ClientSecret Over maximum length. | Error related to configurations. Please check logs for the specific error message. | 
| MST-5200 | Got exception from customer while accessing list of users. | Failure while fetching the list of users from Microsoft Graph API. Please check logs for more details. | 
| MST-5201 | Got exception from customer while accessing list of chats. | Failure while fetching the list of chats from Microsoft Graph API. Please check logs for more details. | 
| MST-5202 | Got exception from customer while accessing meeting chats. | Failure while fetching meeting chats from Microsoft Graph API. Please check logs for more details. | 
| MST-5203 | Got exception from customer while accessing list of groups. | Failure while fetching the list of groups from Microsoft Graph API. Please check logs for more details. | 
| MST-5204 | Got exception from customer while accessing list of channels. | Failure while fetching the list of channels from Microsoft Graph API. Please check logs for more details. | 
| MST-5205 | Error occurred while fetching meeting events. | Failure while fetching meeting events from Microsoft Graph API. Please check logs for more details. | 
| MST-5206 | Error occurred while fetching drive files. | Failure while fetching drive files from Microsoft Graph API. Please check logs for more details. | 
| MST-5207 | Error while InterruptedException rate limit. | Failures while retrying API requests to fetch data from Microsoft Graph API. | 
| MST-5209 | Got exception from customer while running full crawl. | Failures while running full crawl iterator. Please refer logs or contact connector team for more information. | 
| MST-5210 | Exception occurred while accessing list of channel attachment from data source. | Failure while fetching the list of channels attachment from Microsoft Graph API. Please check logs for more details. | 
| MST-5211 | Exception occurred while accessing meeting chat information for user. | Failure while accessing meeting chats from Microsoft Graph API. Please check logs for more details. | 
| MST-5212 | Exception occurred while processing to access list of users. | Failure while processing to access list of users from Microsoft Graph API. Please check logs for more details. | 
| MST-5213 | Exception occurred while processing to access list of groups. | Failure while processing to access list of groups from Microsoft Graph API. Please check logs for more details. | 
| MST-5214 | Exception occurred while processing to access list of channel attachment. | Failure while processing to access list of channel attachment from Microsoft Graph API. Please check logs for more details. | 
| MST-5215 | Exception occurred while processing to access meeting events. | Failure while processing to access meeting events from Microsoft Graph API. Please check logs for more details. | 
| MST-5301 | Got exception from customer while running changelog. | Failures while handling changelog token. Please refer logs or contact connector team for more information. | 
| MST-5302 | Error in serializing change log token. | Failures while serializing change log token. Please refer logs or contact connector team for more information. | 
| MST-5303 | Error in de-serializing change log token. | Failures while de-serializing change log token. Please refer logs or contact connector team for more information. | 
| MST-5400 | Exception occurred while running Identity Crawler. | Error occurred while fetching groups details from Microsoft Graph API. Please check logs for more details. | 
| MST-5401 | Error while build groups details for Identity Crawler. | Failures while de-serializing change log token. Please refer logs or contact connector team for more information. | 
| MST-5500 | Exception occurred while getting file content response. | Error occurred while fetching file content response details from Microsoft Graph API. Please check logs for more details. | 
| MST-5501 | Only String, String List, Date and Long formats are supported for field mappings. | Error related to unsupported field mappings. Please check logs for the specific error message. | 
| MST-5502 | IO Exception occurred. | IO Exception. | 