SharePoint Datasource Plugin
Author: langgenius
Version: 1.0.0
Type: datasource
Introduction
This plugin integrates with Microsoft SharePoint, supporting operations such as retrieving files and documents from your SharePoint sites. It enables automated access to your SharePoint content in platforms like Dify.
Upgrade Notes for 1.0.0
- The default Microsoft OAuth tenant changed from to .
- Existing connections created before 1.0.0 may not have saved.
- Re-authorize existing SharePoint connections after upgrading if refresh fails.
- Set to only when your Microsoft app intentionally allows personal Microsoft accounts.
Datasources
- Documents in Site
- Get files from your Document Library in SharePoint sites.
- Documents in Group
- Get files from your Document Library in SharePoint sites, organized by groups, such as Teams-connected sites.
Setup
IMPORTANT: Only Microsoft Enterprise users can use Sharepoint. To use this plugin, you need the approval of your organization administrator.
-
Register your application in the Microsoft Azure Portal.
-
Create a new application as follows:
- Name: Dify SharePoint Plugin
- Supported account types: choose the account type that matches your tenant policy.
- For company-only access, choose single tenant and enter that tenant ID or domain in Dify.
- For organization-account multi-tenant access, choose organization accounts only and enter in Dify.
- Use the personal Microsoft accounts option only when personal accounts are required, then enter in Dify.
- Redirect URI: Choose and set the URI to:
- For SaaS (cloud.dify.ai) users: please use
- For self-hosted users: please use
Due to the restrictions of the Microsoft OAuth2 flow, redirect URIs must start with or .
-
Copy your Application (client) ID
-
Create a new client secret:
- Description: Dify SharePoint Plugin Secret
- Expires: Whatever duration you prefer (e.g., 1 year, 2 years, etc.)
- Copy the generated Value of the client secret.
-
Configure API permissions:
- Go to "API permissions" section
- Add the following Microsoft Graph permissions:
- (delegated)
- (delegated)
- (delegated)
- (delegated, required if you want to access files in groups)
- Grant admin consent for these permissions
-
Configure the plugin in Dify:
- Fill in the Client ID and Client Secret fields with the values you copied from the Azure Portal.
- Enter your SharePoint Subdomain (e.g., "mycompany" for mycompany.sharepoint.com)
- Enter your Tenant ID.
- Use your tenant ID or domain for single-tenant apps, for work or school accounts only, or only when personal Microsoft accounts are required.
- Make sure you have the same redirect URI as specified in the Azure Portal. If not, you will need to update it in the Azure Portal.
- Click to initiate the OAuth flow.
-
Enjoy using the SharePoint datasource plugin in Dify!
Datasource Descriptions
SharePoint File Retrieval
Retrieve files and documents from your SharePoint sites. The plugin supports:
- Accessing files from SharePoint document libraries
- Retrieving files from specific SharePoint sites
- Supporting various file formats (documents, spreadsheets, presentations, etc.)
Parameters:
- SharePoint subdomain: Your organization's SharePoint subdomain
- File path: The path to the file you want to retrieve
- Site URL: The specific SharePoint site URL (optional)
PRIVACY
Please refer to the Privacy Policy for information on how your data is handled when using this plugin.
Last updated: September 1, 2025