SharePoint Setup Guide link
Follow our setup guide to connect SharePoint to Fivetran.
Prerequisiteslink
To connect SharePoint to Fivetran, you need:
- A SharePoint account
- A SharePoint folder containing files with supported file types and encodings
- The ability to grant Fivetran permission to read from this account
Setup instructionslink
Choose SharePoint access typelink
Decide how you want Fivetran to access your SharePoint site. You can configure the connector in different ways depending on your permission levels within Microsoft.
In the connector setup form, select your Access Type:
Access to All Sites: Access to all SharePoint sites. The following roles can set up the connector:
- SharePoint Administrator (admin). See our setup instructions.
- SharePoint User (non-admin). However, a SharePoint admin has to perform the configuration steps in the Azure portal. See our setup instructions.
NOTE: Fivetran needs
files.read
,offline_access
, andSites.Read.All
permissions for this access type.Access to Limited Sites: Access to a specific SharePoint site. A SharePoint admin must set up the connector and grant Fivetran access to the SharePoint site. See our setup instructions.
NOTE: Fivetran needs
User.Read
andSites.Selected
permissions for this access type.
NOTE: For more information about permissions, see Microsoft's documentation.
Configure SharePoint accesslink
(Optional) Access to All Sites - connector setup by adminlink
A SharePoint admin must authorize and approve the Fivetran application. Skip to the Find folder URL step.
(Optional) Access to All Sites - connector setup by non-adminlink
IMPORTANT: This step is mandatory if you have selected the Access to All Sites option and want a SharePoint user to authorize the Fivetran connector. A SharePoint admin has to perform the following steps in the Azure portal.
The SharePoint admin can do either of the following:
Allow users to directly consent the apps. Do the following:
- In the Azure Portal, go to Microsoft Entra ID > Enterprise applications > Consent and permissions.
TIP: Microsoft Entra ID was formerly Azure Active Directory.
Go to User consent settings. Select Allow user consent for apps from verified publishers, for selected permissions (Recommended). Click Save.
Go to Permission classifications. Click Add permissions.
Select Microsoft Graph. Add the following permissions:
Sites.Read.All
Files.Read
offline_access
profile
openid
email
Allow users to ask for admin consent. Do the following:
- In the Azure Portal, go to Microsoft Entra ID > Enterprise applications > Consent and permissions. Go to Admin consent settings.
- Set the Users can request admin consent to apps they are unable to consent to toggle to Yes.
NOTE: When setting up the connector, during authorization, you will see an approval prompt, and you must click Request Approval. In the Admin consent settings tab, the SharePoint admin will see this request in the Admin consent requests section. The admin must approve the request.
IMPORTANT: If neither of the above settings can be configured, then the admin must authorize Fivetran through the connector setup form by clicking Authorize. Once the admin authorizes, a non-admin user can continue the connector configuration.
Skip to the Find folder URL step.
(Optional) Access to Limited Sites - Connector setuplink
IMPORTANT: Perform the following steps only if you selected the Access to Limited Sites option. A SharePoint admin must perform the following steps.
Find Tenant IDlink
In the Azure Portal, go to Microsoft Entra ID.
Go to the Overview tab and copy the Tenant ID. You will need it later in this step.
Find SharePoint Site IDlink
Log in to Sharepoint and then navigate to the site you would like to connect to Fivetran.
Go to Home and copy the site URL.
Append
/_api/site/id
to the copied URL. Enter the updated URL in the browser.Find your Site ID as illustrated below. Ensure that you are signed in to your SharePoint site when performing this step.
Make a note of the Site ID. You will need this later in this step.
Grant Fivetran access to your sitelink
To grant Fivetran access to the SharePoint site where your folder is present, you must provide read permission of your site to the Fivetran application. You can grant permission in two ways:
TIP: We recommend using the first option.
By using the Microsoft Graph Explorer tool:
- Log in to the Microsoft Graph Explorer.
- Click the profile avatar and then click Consent to permissions > Consent for
Sites.FullControl.All
.NOTE: You grant
Sites.FullControl.All
permission to Microsoft Graph Explorer, and not to the Fivetran application. Using the tool, you grant read permission of your site to the Fivetran application. You can revoke the permission for Microsoft Graph Explorer after connector creation. - Run the Microsoft Graph query. Replace
{site_id}
with the Site ID you found above. The query grants permission of your site to Fivetran application with IDfc84eb7d-8983-4279-858a-45a9dafd02b0
.
NOTE: If the permission is successfully granted, the query returns 201 created response.
By creating an app in Microsoft Entra ID:
In the Azure Portal, go to Microsoft Entra ID > App Registrations > New Registration.
Enter the Name and click Register.
In the Overview section of your app, make a note of Application (client) ID. You will need it later in this step.
Navigate to API permissions > Add a permission > Microsoft Graph > Application permissions > Add
Sites.FullControl.All
permission.NOTE: You don't grant
Sites.FullControl.All
permission to Fivetran. Fivetran doesn't have access to this app. Using this app, you grant read permission of your site to Fivetran. You may delete your app after connector creation.Click Grant Admin Consent for {your tenant name} > Yes.
Go to Certificates & secrets > Add New client secret. Make a note of the value. This is the client secret value that you will need later in this step.
NOTE: The value won't be available once you leave the page.
In Postman, click Import > Raw Text. Paste the following curl request:
curl -X POST -H "Content-Type: application/x-www-form-urlencoded" -d 'client_id=&scope=https%3A%2F%2Fgraph.microsoft.com%2F.default&client_secret=&grant_type=client_credentials' 'https://login.microsoftonline.com/{tenant_id}/oauth2/v2.0/token'
NOTE: You can also use terminal to run the curl request.
In the request body, specify the
client_id
andclient_secret
values you found above.In the request URL, replace
{tenant_id}
with the Tenant ID value you found above.Send the request and make a note of the Access Token that is generated. You will need this later in this step.
In Postman, import the following curl request:
curl --location -g --request POST "https://graph.microsoft.com/v1.0/sites/{site_id}/permissions" \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer {access_token}' \ --data-raw '{ "roles": ["read"], "grantedToIdentities": [{ "application": { "id": "fc84eb7d-8983-4279-858a-45a9dafd02b0", "displayName": "Fivetran App for Limited Access" } }] }'
- In the request header, replace
{access_token}
with the access token generated above. - In the request URL, replace
{site_id}
with the Site ID you found above. - Send the request. The request grants permission of your site to the Fivetran application with ID
fc84eb7d-8983-4279-858a-45a9dafd02b0
.
NOTE: If the permission is successfully granted, the request returns 201 created response.
IMPORTANT: If the connector setup tests fail, even after giving us permission for your SharePoint site, re-authorize our application. In the connector setup form, click Re-Authorize Connection.
Find folder URLlink
Log in to your SharePoint account.
Navigate to the folder you want to sync.
Find the URL of the folder. Click Copy link and then Copy to make a note of it. You will need it to configure Fivetran.
Select sync strategylink
In the connector setup form, select the Sync Strategy: Magic Folder or Merge Mode
Enter the Destination schema name of your choice.
If you selected Merge Mode as your sync strategy, enter the Destination table name.
If you selected Access Type as Access to Limited Sites, enter the Microsoft Entra ID (formerly Azure Active Directory) Tenant ID of your Sharepoint Site, you found above.
Click Authorize. You will be redirected to your SharePoint account to authorize Fivetran's access. Once you have finished, you will be redirected back to Fivetran.
IMPORTANT: Ensure that you (or the user who authorizes) is a member of the SharePoint site you want to sync.
Configure connectorlink
Magic Folderlink
In the connector setup form, in the Folder share link field, enter the folder URL you found in Step 3.
Merge Modelink
In the setup form, choose your configuration options. Using these configuration options, you can select subsets of your folders, specific types of files, and more to sync only the files you need in your destination. In addition, setting up multiple SharePoint connectors targeted at the same file system but with different options allows you to slice and dice a file system any way you'd like, to get exactly the data you want into each table.
You can use the following configuration options:
(Required) Folder Path - Use the folder path to specify a portion of the file system in which you'd like Fivetran to look for files. We examine files under the specified folder and all of its nested subfolders for files we can sync. If you don't provide a prefix, we'll look through the entire file system for files to sync.
(Optional) File Pattern - Use a regular expression as the file pattern to decide whether or not to sync specific files. The pattern applies to everything under the prefix (folder path). If you're unsure what regular expression to use, you can leave this field blank, and we'll sync everything under the prefix.
For example, if under the prefix
logs
, you have three folders:2017
,2016
, anderrors
. Using the pattern\d\d\d\d/.*
, you can exclude all the files in theerrors
folder because:\d\d\d\d
only applies to the folders whose name consists of four consecutive digits, and.*
after/
applies to any files in these folders
TIP: You can learn to write your regex and test it out.
File Type - Use the file type to choose the parsing strategy for files without file extensions. If you save your files with improper extensions, you can force them to be synced as the selected file type.
If you select infer, we infer the type from a file's extension (.csv, .tsv, .json, .avro, or .log).
NOTE: If you have XML files, don't select infer. We sync XML files only when you select the file type as xml. For more information about the file size, see our documentation.
If you choose a file type, we interpret every file we examine as the file type you select, so make sure everything we sync has the same file type.
For example, if you have an automated CSV output system that saves files without a .csv extension, you can specify the type as csv, and we will sync them correctly as CSVs.
If you select xml, we load your XML data into the
_data
column without flattening it.
(Optional) JSON Delivery Mode - Available when JSON or JSONL is selected in File Type. Use this option to choose how Fivetran should handle your JSON data.
- If you select Packed, we load all your JSON data into the
_data
column without flattening it. - If you select Unpacked, we flatten one level of columns and infer their data types.
- If you select Packed, we load all your JSON data into the
Compression - Use the compression option to choose the compression strategy to decompress files without compression extensions. If your files are compressed but do not have extensions indicating the compression method, you can decompress them according to the selected compression algorithm.
If all of your compressed files are correctly marked with a matching compression extension (.bz2, .gz, .gzip, .tar, or .zip), you can select infer.
If you select uncompressed, we do not decompress the files and sync the uncompressed files.
If you choose a compression format, we decompress every file using the format you select.
For example, if you have an automated CSV output system that GZIPs files to save space but saves them without a .gzip extension, you can set this field to GZIP. We will decompress every file that we examine using GZIP.
Error Handling - Use the error handling option to choose how to handle errors in your files. If you know that your files contain some errors, you can choose to skip poorly formatted lines.
If you select skip, we ignore improperly formatted data within a file, allowing you to sync only valid data.
If you select fail, we do not sync a file if we detect improperly formatted data in the file.
TIP: We recommend that you select fail unless you are sure that you have undesirable, malformed data.
You will receive a notification on your Fivetran dashboard if we encounter errors.
(Optional) To use the advanced configuration options, set the Enable Advanced Options toggle to ON.
You can use the following configuration options for specific use cases:
Modified File Merge - Use this option to let Fivetran know how to update files in the destination. When you modify a previously synced file, should we replace the rows in the destination table or append the new rows to the table:
upsert_file replaces records in destination, using the filename and line number as the primary key.
append_file appends records.
(Optional) Archive Folder Pattern - Use a regular expression to filter and sync files from archived folders. We sync the files in compressed archives with filenames matching the specified pattern. If there are multiple files within archive (TAR or ZIP) folders, you can use the archive folder pattern to filter file types.
For example, if you specify the archive folder pattern as
.*json
, we will sync only the files that end in a .json file extension from the archive folder.NOTE: This is only used to filter the files within the archived folder.
(Optional) Null Sequence - Specify the value indicating null if your CSVs use a special value indicating null.
Only use this field if you are sure your CSVs have a null sequence. CSVs have no native notion of a null character. However, some CSV generators have created one, using characters such as
\N
to represent null.TIP: The text is un-escaped before the null sequence is matched, so don't use the escape character in your null sequence.
(Optional) Delimiter - Specify the delimiter. The delimiter is a character used in files to separate one field from the next. Fivetran tries to infer the delimiter, but in some cases, this is impossible. If your files sync with the wrong number of columns or uses a unique delimiter, consider setting this value. For example, if you have tab-delimited files, you must enter
\t
, and if you have pipe-delimited files, enter|
.If you leave this field blank, we infer the delimiter for each file. You can store files of many different types of delimiters in the same folder with no problems. For more information on the delimiter inference, see our documentation.
If you specify a delimiter, we parse all the CSV, TSV, and TXT files in your folder path with this delimiter.
NOTE: You can also specify a multi-character delimiter in this field. A custom multi-character delimiter (excluding "\t" and "\s") should be mentioned only if the source contains only csv files, else it might lead to data integrity issues for other files. The length of custom multi-character delimiter should not exceed 15 characters.
(Optional) Escape Character - Set the escape character if your CSV generator follows non-standard rules for escaping quotation marks.
Only use this field if you are sure your CSVs have a different escape character. CSVs have a special rule for escaping quotation marks compared to other characters; they require two consecutive double quotes to represent an escaped double quote. However, some CSV generators do not follow this rule and use different characters like backslash for escaping.
(Optional) Skip Header Lines - Use this option to skip over fixed-length headers at the beginning of your CSV files. Set the toggle to ON, and then in the Number of skipped header lines field, specify the number of header lines you want to skip.
Some CSV-generating programs include additional header lines or empty lines at the top of the file. The header consists of a few lines that do not match the format of the rest of the rows in the file. These header rows can cause undesired behavior because we attempt to parse them as if they were records in your CSV.
(Optional) Skip Footer Lines - Use this option to skip over fixed-length footers at the end of your CSV files. Set the toggle to ON, and then in the Number of skipped footer lines field, specify the number of footer lines you want to skip.
Some CSV-generating programs include a footer at the bottom of the file. The footer consists of a few lines that do not match the format of the rest of the rows in the file. These footer rows can cause undesired behavior because we attempt to parse them as if they were records in your CSV.
(Optional) Headerless Files - Set the toggle to ON if your CSV-generating software doesn't provide a header line for the documents. Fivetran can generate the generic column names and sync data rows with them.
Some CSV-generating programs do not include column name headers for the files; they only contain data rows. When you set the toggle to ON, we generate generic column names following the convention of
column_0
,column_1
, ...column_n
to map the rows.(Optional) Line Separator - Specify the custom line separator for your CSV files. The line separator is used in files to separate one row from the next.
If you leave this field blank, we use the new line character
\n
as the line separator by default.If you specify a line separator, we parse all the CSV files in your folder path with this line separator.
Finish Fivetran configurationlink
Click Save & Test. Fivetran will take it from here and sync your data from your SharePoint account.
Related articleslink
description Connector Overview
account_tree Schema Information
settings API Connector Configuration