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

# Data Sources

> A data source describes a location at which a user's data is stored. When connected, the GenAI platform is able to read data from that location. This allows knowledge bases to be created from the data source.

Data sources are used to create Knowledge bases on the GenAI platform. Knowledge bases can be connected to data sources through either a one time or periodic sync configuration.

When a knowledge base upload is created from a data source, it will read data from it, extract text from relevant files, split it into chunks, embed the chunks, and store the embeddings in a vector database for future retrieval.

## Connecting a Data Source

Data sources can be connected here inside the platform. How they are connected depends on the data source that the user chooses. Currently, GenAI Platform supports the following sources:

* AWS S3
* Google Drive
* Azure Blob Storage
* MS SharePoint

See below for how to connect a specific data source.

## AWS S3

In order to connect a S3 bucket, you need to:

1. \[In AWS] Configure an IAM Role and Trust Relationship.
2. \[In AWS] Configure an IAM Policy attached to that role to grant S3 privileges.
3. \[In SGP] Connect your data source.

### Configuring an IAM Role

1. Navigate to the IAM Service on the AWS Console.
2. Select **Roles** on the left hand navigation pane.
3. Select the following configurations:

<Frame>
  <img src="https://mintcdn.com/scalegp/E4QRE88hrDqzkijh/images/fd97412-84db204-image.png?fit=max&auto=format&n=E4QRE88hrDqzkijh&q=85&s=dc9d9db8b79afe4781f8461571144212" width="2716" height="1524" data-path="images/fd97412-84db204-image.png" />
</Frame>

1. Create role for AWS Account
2. Another AWS account. the Scale AWS Account ID is: **307185671274**
3. Check the "Require external ID" box
   1. External ID:  (located in SGP below)

<Frame>
  <img src="https://mintcdn.com/scalegp/1vQnbXFkjbQbcgd1/images/3b0155d-a55da0a-image.png?fit=max&auto=format&n=1vQnbXFkjbQbcgd1&q=85&s=5c0e2f562dfa0631c0a91b057120090e" alt="External ID in SGP for AWS account" width="1806" height="1116" data-path="images/3b0155d-a55da0a-image.png" />
</Frame>

> <Icon icon="book" size="24" /> **The goal of AWS's external ID is to provide protection against Scale accidentally assuming the role of a different external account. Given this, we map it to your account ID, and do not allow modification of it. You can find more details [here](https://docs.aws.amazon.com/IAM/latest/UserGuide/confused-deputy.html).**

4. Click Next, and you should be able to see a Permissions tab. This maps to the Policies that we will create in the next section. If you already have a policy that matches, then you can attach it directly and skip the next section. Otherwise, just click Next again.
5. At the last step, give the role the name ScaleAI-Integration. Below that pane, you should be able to see the generated IAM Trust Policy for the Role.

<Frame>
  <img src="https://mintcdn.com/scalegp/O7AaA_mlV2hrXLDS/images/80c69db-Screenshot_2024-07-02_at_5.36.53_PM.png?fit=max&auto=format&n=O7AaA_mlV2hrXLDS&q=85&s=7c62506312c1b35788b228194276b8dc" alt="Sample IAM Role Trust Relationship" width="1654" height="746" data-path="images/80c69db-Screenshot_2024-07-02_at_5.36.53_PM.png" />
</Frame>

#### Sample IAM Role Trust Relationship

```JSON theme={null}
{
	"Version": "2012-10-17",
	"Statement": [
		{
			"Effect": "Allow",
			"Principal": {
				"AWS": "arn:aws:iam::307185671274:root"
			},
			"Action": "sts:AssumeRole",
			"Condition": {
				"StringEquals": {
					"sts:ExternalId": "<ScaleAccountID>"
				}
			}
		}
	]
```

### Configuring an IAM Policy for the Role

1. Navigate back to the Roles tab and click on the ScaleAI-Integration role.

<Frame>
  <img src="https://mintcdn.com/scalegp/O7AaA_mlV2hrXLDS/images/9ea762f-Screenshot_2024-07-02_at_5.45.35_PM.png?fit=max&auto=format&n=O7AaA_mlV2hrXLDS&q=85&s=8b1176ac45140ab02c7f8bd44fafbbce" alt="ScaleAI-Integration role" width="1866" height="618" data-path="images/9ea762f-Screenshot_2024-07-02_at_5.45.35_PM.png" />
</Frame>

2. Go to the block called **Permissions Policies**. On the right-hand side, select **Add Permissions**, and then select **Create Inline Policy**.

<Frame>
  <img src="https://mintcdn.com/scalegp/_1tSRXzqUSANQJ5q/images/a6cc40b-c081344-image.png?fit=max&auto=format&n=_1tSRXzqUSANQJ5q&q=85&s=37ab888fe40023d0b76ed0d815ddf955" alt="Create Inline Policy" width="2812" height="776" data-path="images/a6cc40b-c081344-image.png" />
</Frame>

3. Under Select a Service, select **S3**. SGP will need 2 permissions in order to properly read the files in your bucket:
   1. **ListBucket**, under the **List** section
   2. **GetObject**, under the **Read** section

<Frame>
  <img src="https://mintcdn.com/scalegp/E4QRE88hrDqzkijh/images/fa84f2b-30ae145-image.png?fit=max&auto=format&n=E4QRE88hrDqzkijh&q=85&s=a0ff353e88efafdc7b553c9b8c67362f" alt="S3 permissions ListBucket and GetObject" width="2546" height="1510" data-path="images/fa84f2b-30ae145-image.png" />
</Frame>

4. Next, look for the Resources section below the Permission section. These permissions will determine the buckets and objects Scale's GenPlatform can read.

<Frame>
  <img src="https://mintcdn.com/scalegp/1vQnbXFkjbQbcgd1/images/3b78897-d0041e0-image.png?fit=max&auto=format&n=1vQnbXFkjbQbcgd1&q=85&s=bc2022697bc5e35c0fe4fd9a3a4d040c" alt="Resources section for S3 permissions" width="2686" height="594" data-path="images/3b78897-d0041e0-image.png" />
</Frame>

> <Icon icon="book" size="24" /> **For best results with our ingestion pipelines, we recommend specifying certain buckets and then allowing all objects within that bucket to be read.**

1. To select a bucket to give access to, click **Add ARNs** in the bucket row.

<Frame>
  <img src="https://mintcdn.com/scalegp/E4QRE88hrDqzkijh/images/e5345b6-d0041e0-image.png?fit=max&auto=format&n=E4QRE88hrDqzkijh&q=85&s=f433a781899dc45a63378d56da6d18ef" alt="Add ARNs for buckets" width="2686" height="594" data-path="images/e5345b6-d0041e0-image.png" />
</Frame>

2. To select which objects in that bucket to give access to, click **Add ARNs** in the object row. For best results, we recommend allowing the entire bucket to be read.

<Frame>
  <img src="https://mintcdn.com/scalegp/E4QRE88hrDqzkijh/images/fe1b5ef-b11293d-image.png?fit=max&auto=format&n=E4QRE88hrDqzkijh&q=85&s=e8b8e5aa51f5fb90e0a4a4bfe1bea3c7" alt="Add ARNs for objects" width="1672" height="810" data-path="images/fe1b5ef-b11293d-image.png" />
</Frame>

5. After selecting which buckets and objects to give permission to, name the Policy any name, and then select **Create Policy**.

### Connect Your Data Source

1. Navigate to Data Sources in the GenAI Platform.
2. Click **New Data Source** and select **AWS S3**

<Frame>
  <img src="https://mintcdn.com/scalegp/O7AaA_mlV2hrXLDS/images/7d8ad4d-Screenshot_2024-07-03_at_10.45.01_AM.png?fit=max&auto=format&n=O7AaA_mlV2hrXLDS&q=85&s=8f34f84f86feabe9c9c6fc48f43cb819" alt="New Data Source - AWS S3" width="1030" height="326" data-path="images/7d8ad4d-Screenshot_2024-07-03_at_10.45.01_AM.png" />
</Frame>

3. Fill out the following:

<Frame>
  <img src="https://mintcdn.com/scalegp/E4QRE88hrDqzkijh/images/ec30415-Screenshot_2024-07-03_at_10.45.25_AM.png?fit=max&auto=format&n=E4QRE88hrDqzkijh&q=85&s=ea266109200df4570561206adaa08670" alt="AWS S3 Data Source form" width="1662" height="988" data-path="images/ec30415-Screenshot_2024-07-03_at_10.45.25_AM.png" />
</Frame>

1. **AWS Account ID**: Your AWS Account ID
2. **S3 Bucket Name**: The name of the S3 Bucket where the dats is stored
   1. Note: If you have multiple S3 Buckets, you'll have to connect them as separate data sources.
3. **S3 Bucket AWS Region**: The region your bucket is configured to
4. Connect your data source. This can take a while, so be patient while the screen is loading.

## Google Drive

In order to connect a Google Drive folder, you need to:

1. \[In Google Cloud] Set up a service account.
2. \[In Google Cloud] Enable the Google Drive API.
3. \[In Google Cloud] Create a Key.
4. \[In Google Drive] Share the Drive folder with the service account.
5. \[In SGP] Connect your data source.

### Set up a service account

1. Navigate to the [Google Cloud Console](https://console.cloud.google.com/flows/enableapi?apiid=iam.googleapis.com\&redirect=https://console.cloud.google.com&%5Fga=2.20696049.836172243.1711037194-1950818969.1705955854).
2. Create a new project. Or select an existing project.

<Frame>
  <img src="https://mintcdn.com/scalegp/O7AaA_mlV2hrXLDS/images/907bceb-Screenshot_2024-07-03_at_1.01.01_PM.png?fit=max&auto=format&n=O7AaA_mlV2hrXLDS&q=85&s=06ea6d39255b10278eae82d14a6233f8" alt="Create or Select Project" width="1924" height="1592" data-path="images/907bceb-Screenshot_2024-07-03_at_1.01.01_PM.png" />
</Frame>

3. Enable API access for this project.

<Frame>
  <img src="https://mintcdn.com/scalegp/E4QRE88hrDqzkijh/images/c596ba5-8026b91-image.png?fit=max&auto=format&n=E4QRE88hrDqzkijh&q=85&s=054ebe0791b02e054bc73bb34d28a8df" alt="Enable API Access" width="1582" height="464" data-path="images/c596ba5-8026b91-image.png" />
</Frame>

4. Navigate to **Service Account** on the left side menu. Click **Create Service Account**.

<Frame>
  <img src="https://mintcdn.com/scalegp/_1tSRXzqUSANQJ5q/images/b8bc19e-Screenshot_2024-07-03_at_12.29.59_PM.png?fit=max&auto=format&n=_1tSRXzqUSANQJ5q&q=85&s=fbe8513789a4669b3c5ad490b12cea0c" alt="Create Service Account" width="1776" height="934" data-path="images/b8bc19e-Screenshot_2024-07-03_at_12.29.59_PM.png" />
</Frame>

5. Create the Service account

   1. Fill in the service account details (up to you).

   <Frame>
     <img src="https://mintcdn.com/scalegp/1vQnbXFkjbQbcgd1/images/1f429e6-981c274-image.png?fit=max&auto=format&n=1vQnbXFkjbQbcgd1&q=85&s=944e86ac0a9ef319d97ceab949013bfe" alt="Service Account Details" width="1928" height="1390" data-path="images/1f429e6-981c274-image.png" />
   </Frame>

   2. Grant service account roles and access (up to you). We recommend the **Owner** role.

   <Frame>
     <img src="https://mintcdn.com/scalegp/E4QRE88hrDqzkijh/images/c6bff04-Screenshot_2024-07-03_at_12.31.33_PM.png?fit=max&auto=format&n=E4QRE88hrDqzkijh&q=85&s=4b78382f572c270c2346ffceacfb801a" alt="Grant Service Account Roles" width="1804" height="1124" data-path="images/c6bff04-Screenshot_2024-07-03_at_12.31.33_PM.png" />
   </Frame>

### Enable the Google Drive API

1. Navigate to the [API Console](https://console.developers.google.com/).
2. Select the project you created earlier.

<Frame>
  <img src="https://mintcdn.com/scalegp/1vQnbXFkjbQbcgd1/images/24e6262-Screenshot_2024-07-03_at_12.35.43_PM.png?fit=max&auto=format&n=1vQnbXFkjbQbcgd1&q=85&s=255d0bb1cfae5a31d23cbd71ae69d9e9" alt="APIs & Services Library" width="2038" height="974" data-path="images/24e6262-Screenshot_2024-07-03_at_12.35.43_PM.png" />
</Frame>

3. Open side menu and select **APIs & services**, and then select **Library.**
4. Search for the **Google Drive Api** in the **Library**.

<Frame>
  <img src="https://mintcdn.com/scalegp/E4QRE88hrDqzkijh/images/e497a7c-Screenshot_2024-07-03_at_12.36.29_PM.png?fit=max&auto=format&n=E4QRE88hrDqzkijh&q=85&s=e44dc2ce81d95b3d061129767148b743" alt="Google Drive API Search" width="2026" height="640" data-path="images/e497a7c-Screenshot_2024-07-03_at_12.36.29_PM.png" />
</Frame>

5. Click **ENABLE**.

<Frame>
  <img src="https://mintcdn.com/scalegp/_1tSRXzqUSANQJ5q/images/b3195cd-Screenshot_2024-07-03_at_12.36.40_PM.png?fit=max&auto=format&n=_1tSRXzqUSANQJ5q&q=85&s=3563fe34043967a6cc669f2bd7f2529b" alt="Enable Google Drive API" width="1448" height="702" data-path="images/b3195cd-Screenshot_2024-07-03_at_12.36.40_PM.png" />
</Frame>

See more detailed instructions from Google [here](https://support.google.com/googleapi/answer/6158841?hl=en).

### Create a Key

1. Select the created service account.

<Frame>
  <img src="https://mintcdn.com/scalegp/O7AaA_mlV2hrXLDS/images/727a2cf-Screenshot_2024-07-03_at_12.37.33_PM.png?fit=max&auto=format&n=O7AaA_mlV2hrXLDS&q=85&s=f1d376f16303b20fa68341999766aede" alt="Select Service Account" width="1870" height="734" data-path="images/727a2cf-Screenshot_2024-07-03_at_12.37.33_PM.png" />
</Frame>

2. Navigate to the **KEYS** tab.

<Frame>
  <img src="https://mintcdn.com/scalegp/_1tSRXzqUSANQJ5q/images/ba04342-Screenshot_2024-07-03_at_12.37.55_PM.png?fit=max&auto=format&n=_1tSRXzqUSANQJ5q&q=85&s=b67b0fccd6fac053045f991ec8ad1851" alt="KEYS Tab" width="2410" height="1072" data-path="images/ba04342-Screenshot_2024-07-03_at_12.37.55_PM.png" />
</Frame>

3. Select **ADD KEY**, and Create a new JSON Key.

<Frame>
  <img src="https://mintcdn.com/scalegp/E4QRE88hrDqzkijh/images/ec54a75-Screenshot_2024-07-03_at_12.38.07_PM.png?fit=max&auto=format&n=E4QRE88hrDqzkijh&q=85&s=e32d804b71c95d8f87bf8b9e597a4e64" alt="Add Key - Create JSON Key" width="1898" height="1088" data-path="images/ec54a75-Screenshot_2024-07-03_at_12.38.07_PM.png" />
</Frame>

4. The Private Key will be saved to your computer. The credentials will be used later when we connect our data source.

<Frame>
  <img src="https://mintcdn.com/scalegp/O7AaA_mlV2hrXLDS/images/774a25e-Screenshot_2024-07-03_at_12.38.29_PM.png?fit=max&auto=format&n=O7AaA_mlV2hrXLDS&q=85&s=7ddf80e7df7258c9e9a123cd066bc3aa" alt="Private Key Saved" width="1974" height="576" data-path="images/774a25e-Screenshot_2024-07-03_at_12.38.29_PM.png" />
</Frame>

### Share the Drive folder with the service account

Share the drive folder you want to connect with the service account you just created.

<Frame>
  <img src="https://mintcdn.com/scalegp/O7AaA_mlV2hrXLDS/images/79585b6-Screenshot_2024-07-03_at_12.47.16_PM.png?fit=max&auto=format&n=O7AaA_mlV2hrXLDS&q=85&s=fae02c39fdd11349afd683c918eb865c" width="1012" height="926" data-path="images/79585b6-Screenshot_2024-07-03_at_12.47.16_PM.png" />
</Frame>

![]()

### Connect your data source

#### Information from the Key created

We will need the following fields from the JSON Below: `client_email`, `client_id` , `private_key` , `token_uri`

> <Icon icon="book" size="24" /> **For the private key, be sure to copy and paste the entire string in the file, inclusive of the sections "BEGIN PRIVATE KEY" and "END PRIVATE KEY".**

```Bash theme={null}
{
  "type": "service_account",
  "project_id": "sgp-g-drive-data-source-test",
  "private_key_id": "9ba310c026227509efd6fa5917d1b8d971791811",
  "private_key": "-----BEGIN PRIVATE KEY-----\*****redacted*****\n-----END PRIVATE KEY-----\n",
  "client_email": "scaleai-service-account@sgp-g-drive-data-source-test.iam.gserviceaccount.com",
  "client_id": "118190969327709508303",
  "auth_uri": "https://accounts.google.com/o/oauth2/auth",
  "token_uri": "https://oauth2.googleapis.com/token",
  "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
  "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/scaleai-service-account%40sgp-g-drive-data-source-test.iam.gserviceaccount.com",
  "universe_domain": "googleapis.com"
}
```

#### Google Drive Folder ID

<Frame>
  <img src="https://mintcdn.com/scalegp/E4QRE88hrDqzkijh/images/cd6eba4-Screenshot_2024-07-03_at_12.45.15_PM.png?fit=max&auto=format&n=E4QRE88hrDqzkijh&q=85&s=cc89f85289b6d8c4d2df4c30c73a4d03" alt="Google Drive Folder ID" width="1724" height="112" data-path="images/cd6eba4-Screenshot_2024-07-03_at_12.45.15_PM.png" />
</Frame>

#### Connecting Data Source

With the information above, you can connect your data source.

<Frame>
  <img src="https://mintcdn.com/scalegp/1vQnbXFkjbQbcgd1/images/4d737e6-Screenshot_2024-07-03_at_1.27.42_PM.png?fit=max&auto=format&n=1vQnbXFkjbQbcgd1&q=85&s=d8db647f52c30eb658c1ea15d56fe224" alt="Connecting Data Source" width="2032" height="1282" data-path="images/4d737e6-Screenshot_2024-07-03_at_1.27.42_PM.png" />
</Frame>

> <Icon icon="book" size="24" /> **ScaleAI will only store an encrypted version of your credentials to be used to scrape from the folders**

## Azure Blob Storage

In order to connect an Azure Storage Container, you need to

1. Identify the **Container URL**.
2. Generate a shared access signature (SAS) and grant SGP restricted access to the Azure Storage container.
3. Connect your data source.

### Locate the Container URL

1. Go to Microsoft Azure and locate the containers you have.

<Frame>
  <img src="https://mintcdn.com/scalegp/O7AaA_mlV2hrXLDS/images/6c9b937-3935fd6-image.png?fit=max&auto=format&n=O7AaA_mlV2hrXLDS&q=85&s=952e3c81e2bbc827b3bfc92bf6bc7139" alt="Azure Containers" width="2962" height="1524" data-path="images/6c9b937-3935fd6-image.png" />
</Frame>

2. Select the container you have access to. If you don't have a container yet, [create a container](https://learn.microsoft.com/en-us/azure/storage/blobs/storage-quickstart-blobs-portal#create-a-container) and upload data into that container. Click on the three dots on the right-hand side and select **Container Properties**.

<Frame>
  <img src="https://mintcdn.com/scalegp/1vQnbXFkjbQbcgd1/images/308c938-57f44b3-image.png?fit=max&auto=format&n=1vQnbXFkjbQbcgd1&q=85&s=d52291db9b3e0dc8d9528a4fad70a97b" alt="Container Properties" width="2888" height="1412" data-path="images/308c938-57f44b3-image.png" />
</Frame>

3. Locate the **container\_url** on this screen.

<Frame>
  <img src="https://mintcdn.com/scalegp/E4QRE88hrDqzkijh/images/f095fe3-4e47861-image.png?fit=max&auto=format&n=E4QRE88hrDqzkijh&q=85&s=7758715da9befb4a97a785fdf3a609ac" alt="Container URL" width="3456" height="544" data-path="images/f095fe3-4e47861-image.png" />
</Frame>

### Generate SAS

1. Navigate back to the list of containers.

<Frame>
  <img src="https://mintcdn.com/scalegp/O7AaA_mlV2hrXLDS/images/6b2145f-57f44b3-image.png?fit=max&auto=format&n=O7AaA_mlV2hrXLDS&q=85&s=8a16f3f1331178dc9f39ce4f0a0ca876" alt="List of Containers" width="2888" height="1412" data-path="images/6b2145f-57f44b3-image.png" />
</Frame>

2. Click on **Generate SAS**. This is a URI that grants Scale Generative Platform restricted Access to the selected Azure Storage container. In order to access the data in this container, we will need **Read** and **List** privileges.

<Frame>
  <img src="https://mintcdn.com/scalegp/1vQnbXFkjbQbcgd1/images/1722973-a70edaa-image.png?fit=max&auto=format&n=1vQnbXFkjbQbcgd1&q=85&s=7e4c87e7a40db88662f45161f8b24b74" alt="Generate SAS" width="1232" height="1672" data-path="images/1722973-a70edaa-image.png" />
</Frame>

3. After generation, you will see a **Blob SAS Token** and **Blob SAS URL**. To connect a data source, you will need the **Blob SAS Token**.

<Frame>
  <img src="https://mintcdn.com/scalegp/O7AaA_mlV2hrXLDS/images/8c6e85b-Screenshot_2024-07-10_at_3.31.15_PM.png?fit=max&auto=format&n=O7AaA_mlV2hrXLDS&q=85&s=0a02f18dd0af2d429607e56dc20164c4" alt="Blob SAS Token and URL" width="1134" height="274" data-path="images/8c6e85b-Screenshot_2024-07-10_at_3.31.15_PM.png" />
</Frame>

### Connect your data source

<Frame>
  <img src="https://mintcdn.com/scalegp/_1tSRXzqUSANQJ5q/images/a41db1e-Screenshot_2024-07-10_at_3.33.51_PM.png?fit=max&auto=format&n=_1tSRXzqUSANQJ5q&q=85&s=513a347a6abc51d2821ec1479c9a228d" alt="Connect Data Source" width="2126" height="918" data-path="images/a41db1e-Screenshot_2024-07-10_at_3.33.51_PM.png" />
</Frame>

Add the **Blob SAS token** and **Container URL** from previous steps and connect your data source.

## MS SharePoint

In order to connect a SharePoint data source, you need to:

1. Create a new App Registration.
2. Grant Sharepoint read access to the App Registration.
3. Create a Client Secret for the App Registration.
4. Obtain the SharePoint site Id.
5. Connect the Data Source.

### Create a new App Registration

1. Navigate to Microsoft Entra ID in the Azure Portal under the organization that owns the SharePoint site you would like to use as a data source.
2. Go to App registrations in the lefthand sidebar and click New registration.

<Frame>
  <img src="https://mintcdn.com/scalegp/E4QRE88hrDqzkijh/images/f2ff9fe-706bc72-Screenshot_2024-04-01_at_2.36.15_PM.png?fit=max&auto=format&n=E4QRE88hrDqzkijh&q=85&s=9615fa045ff1e5f1c8cea87e8affce6c" alt="New Registration" width="2406" height="1240" data-path="images/f2ff9fe-706bc72-Screenshot_2024-04-01_at_2.36.15_PM.png" />
</Frame>

3. Enter a name for the application and select **Accounts in any organizational directory** for **Supported account types**.
4. After creating the new registration, navigate to the registration's **Overview** page to find the respective `client_id` and `tenant_id`.

<Frame>
  <img src="https://mintcdn.com/scalegp/1vQnbXFkjbQbcgd1/images/2fb509a-38c3a95-Screenshot_2024-04-01_at_3.17.21_PM.png?fit=max&auto=format&n=1vQnbXFkjbQbcgd1&q=85&s=e8406aecfaf051941330ff07ae2f2ff9" alt="App Overview" width="1984" height="1230" data-path="images/2fb509a-38c3a95-Screenshot_2024-04-01_at_3.17.21_PM.png" />
</Frame>

### Grant SharePoint read access to the App Registration

1. Navigate to API Permissions in the sidebar.

<Frame>
  <img src="https://mintcdn.com/scalegp/1vQnbXFkjbQbcgd1/images/0fbd5c7-38c3a95-Screenshot_2024-04-01_at_3.17.21_PM_copy.png?fit=max&auto=format&n=1vQnbXFkjbQbcgd1&q=85&s=4689f89e21f1fe0dc5c0e2743395b7b3" alt="API Permissions" width="1984" height="1230" data-path="images/0fbd5c7-38c3a95-Screenshot_2024-04-01_at_3.17.21_PM_copy.png" />
</Frame>

2. Click **Add permission**.
   1. Under **Select an API** choose **Microsoft Graph**.
   2. Select **Application permissions** for permissions type.
   3. Check **Sites.Read.All** under **Sites**.

<Frame>
  <img src="https://mintcdn.com/scalegp/O7AaA_mlV2hrXLDS/images/8e3daa2-51f693d-Screenshot_2024-04-01_at_2.38.04_PM.png?fit=max&auto=format&n=O7AaA_mlV2hrXLDS&q=85&s=90ae0706d62dafb0b4b8135649098dfd" alt="Add Permission" width="3454" height="1486" data-path="images/8e3daa2-51f693d-Screenshot_2024-04-01_at_2.38.04_PM.png" />
</Frame>

> <Icon icon="book" size="24" /> **Note: You may need to reach out to an organization admin to have this permission request approved.**

### Create a Client Secret for the App Registration

1. Navigate to **Certificates and Secrets** in the sidebar.

<Frame>
  <img src="https://mintcdn.com/scalegp/1vQnbXFkjbQbcgd1/images/552b400-51f693d-Screenshot_2024-04-01_at_2.38.04_PM_copy.png?fit=max&auto=format&n=1vQnbXFkjbQbcgd1&q=85&s=817564ea00c2664c3a9dcc1194e8ff86" alt="Certificates and Secrets" width="1732" height="1480" data-path="images/552b400-51f693d-Screenshot_2024-04-01_at_2.38.04_PM_copy.png" />
</Frame>

2. Click **New client secret** and choose a name and expiration date.

> <Icon icon="road-barrier" size="24" /> **Note: you will need to update the client\_secret for the data source after the expiration date**

### Obtain the SharePoint site ID

1. Navigate to the SharePoint admin control center and find the site that you want to use as a data source.
2. Select the site, extract the `**site_id**` from the URL. This will appear at the end of the URL path after `**/SiteDetails**`.

<Frame>
  <img src="https://mintcdn.com/scalegp/O7AaA_mlV2hrXLDS/images/7dbcd93-b7471e6-Screenshot_2024-04-01_at_3.05.28_PM.png?fit=max&auto=format&n=O7AaA_mlV2hrXLDS&q=85&s=2224cffba3b03d952f7c8f226c6c7779" alt="SharePoint Site ID" width="2438" height="1184" data-path="images/7dbcd93-b7471e6-Screenshot_2024-04-01_at_3.05.28_PM.png" />
</Frame>

### Connect the Data Source

Populate with the **Client Secret**, **Client ID**, **Tenant ID**, and **Site ID** from previous steps.

<Frame>
  <img src="https://mintcdn.com/scalegp/E4QRE88hrDqzkijh/images/ed5a698-Screenshot_2024-07-10_at_4.15.42_PM.png?fit=max&auto=format&n=E4QRE88hrDqzkijh&q=85&s=0bb4aff6ef0ed2163d43195fb76dde9f" alt="Connect Data Source" width="2130" height="1072" data-path="images/ed5a698-Screenshot_2024-07-10_at_4.15.42_PM.png" />
</Frame>
