CSV connector
The CSV Graph connector allows your organization to ingest content from CSV files stored in SharePoint libraries and Azure Data Lake Storage (ADLS). After you configure the connector and index content from these sources, end users can find CSV files in Microsoft Search.
Note
Read the Setup for your Graph connector article to understand the general Graph connectors setup instructions.
This article is for anyone who configures, runs, and monitors a CSV connector. It supplements the general setup process, and shows instructions that apply only for this connector.
Before you get started
Make sure there's no whitespace in the CSV headers. For a SharePoint data source, you'll need to create a SharePoint app with Oauth configuration. For an ADLS data source, you'll need to create an ADLS storage account.
Create a SharePoint app with Oauth configuration
Verify the .csv files you want to index have been uploaded to a SharePoint document library. You can use an existing SharePoint site or create a new one.
Create a SharePoint app
- Go to
https://Org-Name.sharepoint.com/sites/mysite/_layouts/15/appregnew.aspx
. - On the Client Id and Client Secret fields, select Generate.
- For Title, enter an app name.
- In the App Domain field, enter
www.gcs.com
. - In the Redirect URL field, enter
https://www.gcs.com
. - Select Create.
- Copy the app configuration information, including the Client ID and Client Secret. You'll need it when you set up the CSV connector.
Enable app permissions to allow CustomAppAuthentication
In PowerShell (SharePoint Online Management Shell), run these commands in administrative mode. Use the email address of the admin configuring the connector and your organization name. When the password pop-up appears, the admin should enter their password.
Install-Module -Name Microsoft.Online.SharePoint.PowerShell
$adminUPN=”<admin@contoso.onmicrosoft.com>”
$orgName=“<contoso>”
$userCredential = Get-Credential -UserName $adminUPN -Message "Enter your password."
Connect-SPOService -Url https://$orgName-admin.sharepoint.com -Credential $userCredential
Set-spotenant –DisableCustomAppAuthentication $false
Note
If you're using PowerShell 7, use this command first Import-Module microsoft.online.sharepoint.powershell -UseWindowsPowerShell
Note
If you're using multifactor authentication, use Connect-SPOService -Url https://$orgName-admin.sharepoint.com
.
Complete the app configuration
- Go to
https://Org-Name.sharepoint.com/sites/mysite/_layouts/15/appinv.aspx
. - In the App Id field, paste the Client Id of the SharePoint app and select Lookup.
- In Permission Request XML field, paste this code and select Create.
<AppPermissionRequests AllowAppOnlyPolicy="true">
<AppPermissionRequest Scope="http://sharepoint/content/sitecollection/web" Right="Read" />
</AppPermissionRequests>
- Select Trust It.
Create an ADLS storage account
For step-by-step guidance, see Create a storage account. To allow file storage capabilities, on the Advanced tab, select Enable hierarchical namespace and Create a Container for this site.
When you set up the CSV connector, you'll need to provide a primary storage connection string. To find it, open the storage account you created and select Access Keys. Select Show Keys and copy the connection string for Key1.
Step 1: Add a Graph connector in the Microsoft 365 admin center
Follow the general setup instructions.
Step 2: Select experiences
Currently, the CSV connector only supports search experiences.
Step 3: Name the connection
Follow the general setup instructions.
Step 4: Configure connection settings
The data source settings are different for SharePoint and ADLS.
Note
Ensure that your csv file does not have any formatting or spaces (‘ ‘) present in header rows.
For a SharePoint source
- In the Data Source settings, select SharePoint as your datasource.
- In SharePoint site, enter the site URL,
https://Org-Name.sharepoint.com/Site-Name
, for example. - In Document Library, enter the name of the library where the .csv files are stored.
- In Authentication Type, select Oauth2.0(client credentials).
- Enter the Client ID and Client Secret you copied when you created the SharePoint app.
- Select Test Connection. You should get a The connection is successful message.
To control access on a file level, enter Microsoft Entra users or groups.
For an ADLS source
- In the Data Source settings, select Azure Data Lake Storage(ADLS) as your datasource.
- In Primary storage connection string, enter the connection string you copied.
- Enter the Container name and Filename.
- Select Test Connection. You should get a The connection is successful message.
Note
If your datasource contains multiple .csv files with the same headers, select include all CSV files in location.
To control access on a file level, enter Microsoft Entra users or groups.
Step 5: Multi-items delimiter (Optional)
If your source columns can take multiple values, enter a multi-items delimiter, a semicolon (;) for example.
Step 6: Parsed properties settings
This page returns the first row from your .csv file as Source Properties. To modify the Datatype, in the Unique Identifier list select at least one option.
To control access on an item level, select columns mapped to Allowed Users and Allowed Groups. You should include two columns, AllowedUsers and AllowedGroups, in the .csv file. Each row should contain the Microsoft Entra IDs.
Note
The CSV connector supports file- or item-level access control. If both are enabled, only the file-level access control is applied.
Step 7: Assign property labels
Follow the general setup instructions.
Note
IconURL label is populated by default and the mapping cannot be changed.
Step 8: Manage schema
Follow the general setup instructions.
Step 9: Manage search permissions
- For file- or item-level access control, select Only people with access to this data source.
- Selecting Everyone allows everyone in your organization to see search results from this data source.
Step 10: Choose refresh settings
Follow the general setup instructions.
Step 11: Review connection
Follow the general setup instructions.
Limitations
The following are known limitations of the CSV connector:
- Profile enrichments scenarios aren't supported at this time.
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for