The typical SharePoint sync method involves providing temporary "All Site" access to AutogenAI, while you select the relevant sites to sync. If your company requires a more controlled approach, this guide details how to use PowerShell to provide specific site-level information to AutogenAI, skipping the "All Site" access steps. For the requirements, see Before you start.
AutogenAI supports integrating with SharePoint. Once you authorize the connection, the selected SharePoint files will be synced to the AutogenAI knowledge hub, so that the AI can source the right information for your writing. If there is a change in the synced SharePoint files at any time, AutogenAI will retrieve the newest version of the file.
In this article
- Before you start
- Step 1: Integrate with SharePoint via the UI
- Step 2: Sync by specifying sites
- Step 3: Share the information with AutogenAI
Before you start
- You need to be comfortable running PowerShell commands. For more information, see PnP PowerShell authentication
- You will need the following permissions:
- Global Admin on Microsoft Entra
- Sites.FullControl.All or Site Collection Administrator permissions of the target site(s)
- You need to have the document manager role on AutogenAI (AutogenAI will grant this)
- Your SharePoint must be synced using the default location within a multi-geo set up. Due to an existing limitation on the Microsoft end, we cannot support syncing data within specific location within a multi-geo set up.
Step 1: Integrate with SharePoint via the UI
Note: This part can be done before or after Step 2: Sync by specifying sites
-
Go to the knowledge hub as a document manager, open Sharepoint Libraries, and click + Sharepoint Libraries in the top-right.
-
You will be taken to a Microsoft login page. Log in.
-
If you don’t have admin access, you will be shown this page.
-
If you have admin access, you will be taken to the following page to grant access to SharePoint-sync. Click Accept.
-
You will be taken back to the AutogenAI page. Click Cancel, so that you are not granting full access to SharePoint sites.
Step 2: Sync by specifying sites
Note: For the order of Steps 1 and 2, see Step 1: Integrate with SharePoint via the UI.
-
To grant permissions to specific sites you need to run the PowerShell script below. Make sure you have the PnP.PowerShell module installed first. If you don’t, you can install it with:
Install-Module PnP.PowerShell
-
Grant AutogenAI read access to the site you want to integrate with via PnP PowerShell by running the following commands. Make sure to replace $yourSiteUri, $autogenClientId and $autogenAppName with the appropriate values.
$clientSiteUri = '<YOUR SITE URL>' # YOUR AUTOGEN APP ID, double check in MS entra $autogenClientId = '68e7342b-03db-41a2-a816-ddf692955e22' $autogenAppName = 'AutogenAI Sharepoint Sync' $tenant = '<YOUR TENANT>.onmicrosoft.com' # Registers new Azure AD app # this step is optional if you already have a PnP PowerShell app with # "AllSites.FullControl" permission or higher Register-PnPAzureADApp -ApplicationName 'PnP PowerShell' -Tenant $tenant -SharePointDelegatePermissions AllSites.FullControl # Copy azure app id / client id value from the previous command output $clientId = <PNP APP ID> # Connect to SharePoint Site Connect-PnPOnline -Url $clientSiteUri -ClientId $clientId -Interactive # Grant the permission to the site Grant-PnPEntraIDAppSitePermission -AppId $autogenClientId -DisplayName $autogenAppName -Permissions Read # Check the permission is granted Get-PnPEntraIDAppSitePermission
Step 3: Share the information with AutogenAI
Provide the following information for every site you want to sync to the AutogenAI team. AutogenAI will finish the setup for you. Note that each site setup you provide maps with one SharePoint library within the AutogenAI knowledge hub.
| Information required | What is it? |
|---|---|
| SharePoint tenant ID | Your SharePoint tenant ID |
| SharePoint site ID | ID of the site |
| SharePoint drive ID | ID of the drive in the site |
| SharePoint site name (if you can’t provide site ID) | Name of the SharePoint site you want to sync |
| SharePoint drive name (if you can’t provide drive ID) | Name of the SharePoint drive you want to sync |
| Paths to sync | "/" if you want all the folders or the folder path. It can be more than one |
| Admin members | Emails of the AutogenAI user(s) that should be added as administrator(s) of the knowledge hub libraries, so that they can add the relevant team members. |
Once it is successful, your AutogenAI contact will let you know and you will see the files syncing into AutogenAI.