Skip to main content

SharePoint

Seamlessly ingest documents, policies, and pages from your SharePoint sites into the Knowledge Repository.

This connector allows SVAHNAR to read and consolidate content from SharePoint site libraries and pages, making them searchable and usable by your AI agents.

💡 Core Concepts

To configure this tool, you need to understand the underlying authentication mechanism.

1. How does the SharePoint Connector work?

The connector uses an Azure AD Application (Service Principal) to authenticate with Microsoft Graph. It acts as a read-only "user" that scans your specified site URL, downloads compatible files (PDFs, Docs, Pages), and normalizes them for the Knowledge Repository.

2. Prerequisites

  • Admin Access: You (or your IT admin) need access to the Azure Portal to register an application.
  • Permissions: The application requires Sites.Read.All permissions to fetch content.

⚙️ Configuration Steps

Follow these steps to register your application and locate the required credentials.

Register Azure App

  1. Log in to the Azure Portal.
  2. Navigate to Azure Active Directory > App registrations > New registration.
  3. Name: Enter a name (e.g., svahnar-knowledge-importer).
  4. Supported account types: Select "Accounts in this organizational directory only" (Single tenant).
  5. Click Register.

Get IDs & Create Secret

  1. Get Client & Tenant IDs:

    • On the App Overview page, copy the Application (client) ID.
    • Copy the Directory (tenant) ID.
  2. Generate Client Secret:

    • Go to Certificates & secrets in the left sidebar.
    • Click New client secret.
    • Add a description and expiry, then click Add.
    • Crucial: Copy the Value immediately. You will not be able to see it again.

Grant Permissions

  1. Go to API permissions in the sidebar.
  2. Click Add a permission > Microsoft Graph.
  3. Select Application permissions (NOT Delegated).
  4. Search for and check Sites.Read.All.
  5. Click Add permissions.
  6. Important: Click the "Grant admin consent for [Your Org]" button to finalize access.

Configure Connector

  1. Locate Site URL:

    • Navigate to your SharePoint site in a browser.
    • Copy the full URL (e.g., https://contoso.sharepoint.com/sites/Engineering).
  2. Input Credentials:

    • Use the tenant_id, client_id, client_secret, and site_url gathered in previous steps to configure the connector payload.

📚 Practical Recipes

Recipe 1: Standard Connector Payload

Use Case: Connecting a specific engineering team site to the repository.

{
"tenant_id": "b348d660-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"client_id": "f8a7e221-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"client_secret": "VGhpcyBpcyBhIHNhbXBsZSBzZWNyZXQgd2hpY2ggaXMgdmVyeSBzZWN1cmU=",
"site_url": "https://yourtenant.sharepoint.com/sites/Engineering"
}

Security Note

Treat your client_secret like a password. Ensure it is stored securely and never exposed in public repositories.


🚑 Troubleshooting

  • 401/403 Access Denied Errors

    • Verify that you clicked "Grant admin consent" in the Azure Portal API Permissions tab.
    • Ensure you selected Application permissions, not Delegated permissions.
    • Check if your client_secret has expired.
  • Missing Files or Pages

    • Verify the site_url is correct. If you need a sub-site, ensure the URL includes the full path.
    • Some complex web parts or custom scripts on SharePoint pages may not translate perfectly to text.
    • Large binary attachments may be skipped depending on your repository ingestion limits.
  • Throttling

    • Microsoft Graph APIs enforce rate limits. If you are importing a massive library, the connector may need to back off and retry. Monitor the logs for throttling warnings.