This article describes how you can sync the existing Knowledge Documents in your Sharepoint SharePoint site with Luma Knowledge.
In Luma Knowledge, we can create a Federated Service with SharePoint to make the Knowledge available to the end-user through the Luma Knowledge (Knowledge Search Widget) or any Luma-Supported Channel. The Data Sync Service creates the artifacts in Luma Knowledge based on the documents available in your SharePoint site. With recurring sync, the artifacts are automatically updated and created based on the updates on the Sharepoint SharePoint portal.
To configure the sync with SharePoint, you should follow the below steps:
Table of Contents |
---|
Step 1: Create an Application
...
to connect to your SharePoint site
The first step is to create an App principal with access to your Sharepoint SharePoint portal. The App enables Luma Knowledge to connect to Sharepoint SharePoint and download documents for artifact creation and updates.
...
Navigate to your SharePoint site. For example, https://xxxxxxxxx.sharepoint.com/sites/Documents.
Open the App registration page. Append /_layouts/15/appregnew.aspx to the site address. The URL should look like:
https://xxxxxxxxx.sharepoint.com/sites/Documents/_layouts/15/appregnew.aspxThe App registration page is now open.
Following details are required to create the App:
Client ID: This is the SharePoint App ID. This is autogenerated by the system. Click Generate.
Client Secret: This is thePassword for the App to connect to SharePoint. This is autogenerated by the system. Click Generate.
Title: Provide a user-friendly display name for the App.
App Domain: This is the Remote server host of the App. Use www.localhost.com if you don't have one.
Redirect URL: This is the Remote application endpoint. Use https://www.localhost.com if you don't have one.
Click Create to create the App.
...
To set permissions for the app, append _layouts/15/appinv.aspx to the site address. The URL should look like:
https://xxxxxxxxx.sharepoint.com/sites/Documents/_layouts/15/appinv.aspxThis will open a new page.
Paste the Client Id (retained in the earlier step) in the App Id field and click Lookup.
This fetches and displays the details of the App Id created earlier.
Provide the Permission Request XML specifying what access the App has. The XML structure is below.
Code Block <AppPermissionRequests AllowAppOnlyPolicy="true"> <AppPermissionRequest Scope="http://sharepoint/content/sitecollection" Right="FullControl" /> </AppPermissionRequests>
You may replace the scope with the following values. These should be used as is, do not modify.
TENANT = http://sharepoint/content/tenant
SITE COLLECTION = http://sharepoint/content/sitecollection
SUB SITE = http://sharepoint/content/sitecollection/web
LIST/LIBRARY = http://sharepoint/content/sitecollection/web/list
'Right' may also be populated with the following permissions. These should be used as is, do not modify.
Read = only read access
Write = add/edit/delete
FullControl = full permissions
Note: Based on the Scope selected, the App may require approval from the Azure Global Administrator.
Click Create.
On the confirmation screen, click on Trust It.
You App is ready to be used.
Now Navigate to the Site Settings → Site App Permissions page to fetch the App identifier for your App. Append ‘appprincipals.aspx?Scope=Web’ to the site address. The URL should look like:
https://xxxxxxxxxx.sharepoint.com/_layouts/15/appprincipals.aspx?Scope=WebCopy the App Identifier and retain it in a notepad or text editor. The identifier is used in Data source configuration in the next step.
Step 2: Configure Sharepoint as Data Source in Luma Knowledge
Now that the App is ready, the next step is to configure Sharepoint in Luma Knowledge. Here, we set up the connection type and connection details to the Sharepoint site you want to connect to.
...
On Luma Knowledge, navigate to Federated Service.
On the Manage Data Sources tab, click on Add Data Source.
Add new Data source details and click on Save.
Once the Data Source is created, click on the new data source to configurethe Authorization Profile.
On Configure Authorization Profile page, add the following details:
Select SHAREPOINT as Connection Type.
On the SharePoint Details section, Add your SharePoint Domain.
Click on Get Tenant Id From SharePoint App. This function automatically populates the Identified Sharepoint Tenant Id and Resolved Resource Client Id from SharePoint.
Now configure your Sharepoint App details in Step 1.
Add the App Identifier in Client ID.
Add Client Secret.
Once the details are added, click on Save.
The Sharepoint data source is now ready.
Step 3: Configure the Object and Data Profile to Export data from Source System- Sharepoint
Once the Data Source is ready, the next step is to create Data Object. This represents the data or entities to be imported from SharePoint. This is the actual end-point from where the document should be downloaded.
...
On the Manage Data Objects tab, select the newly created Data Source in the SourceName field.
Click on Add Data Object
Add the following details:
Provide Data Object Name.
Select SHAREPOINT as Connection Type.
Select the Sharepoint Data Source Name.
Click Save.
Now select the new Data Object from the list and Configure Data Profile. Here we provide details on the data/documents to be imported from the source. Follow the below steps to configure the Data Profile.
On the Configure Data Profile page, select the Connection Type as SHAREPOINT.
Under the SharePoint Details section, add the following details:
Add Data Object Name.
Provide your Sharepoint Site name as Site Name.
Next, add the Folders to be synced. Click on Add to configure one or more folders.
Once the configuration is done, click on Save to complete the profile.
Once the Data Profile is ready, the next step is to configure Object Fields. These fields represent the information to be imported from the source SharePoint site.
Click on Create Data Objects to view the list of Data Objects for the Data Source. Based on the Connection Type, default Object Fields are automatically added.
You may add more Data Objects as required. To add more Data Object, follow the below steps:
Click on Add Object Fields.
Add Object Name and Data Type.
Click on Save.
The new Data Object is added to the list.
Step 4: Configure the Data Source for your Luma Knowledge Tenant
Once the Sharepoint Data Source is ready, the next step is to configure the Data source for your Luma Knowledge instance.
...
On the Manage Data Source tab, select LUMA KMS Current Host Data Source.
On Configure Authorization Profile page, click Edit.
Scroll down to the Separate HTTP Authentication Call section.
Update URL to connect to your Luma Knowledge environment. e.g. https://lumaproedge.serviceaide.com/gateway/api/auth/login.
Provide your Tenant authentication details on the Body tab.
Click on Add to addthe new key value.
Add the key NAME, e.g. JSON_BODY.
In Value, provide the tenant and authentication details in the below JSON format.
{"username":"<Login username>","password":"<password>","subdomain":"<tenant name>"}
e.g. {"username":"Test","password":"XXXXXXX","subdomain":"Test"}Select JSON as Data Type.
Click on Save and update the configuration.
Step 5: Configure the Object and Data Profile to Import data into Destination System - Luma Knowledge
The next step is to create the Data Object to import Documents into Luma Knowledge.
...
On the Manage Data Objects tab, click on Add Data Object.
Add the Data Object Name and Connection details.
The new Data Object is added to the list.
Select the new Data Object to configure the Data Profile.
On Configure Data Profile page, add the following details:
Set Connection Type to REST.
Add the Upload API URL to your Luma Knowledge instance.
e.g. https://lumaproedge.serviceaide.com/gateway/api/v1/artifacts/uploadSet HTTP Method to POST.
Add the following to Request Headers.
Name : Content-Type Value : multipart/form-data Data Type: STRING
Name : ClientType Value : Ajax Data Type: STRING
Name : x-requested-with Value : XMLHttpRequest Data Type: STRING
Select JSON as the Response Type.
Under Extract Response Using, add '$' to the Enter JSON Path. This enables the system to read the complete response received from the Source system (Sharepoint).
Set Is Paged Response to True and Paging Strategy to POST_PAYLOAD.
Click on Save to complete the configuration.
Now click on Create Data Object Fields to view the list of Data Objects for the Data Source. Based on the Connection Type, default Object Fields are automatically added. You may add more Data Object fields as required.
Step 6: Configure the Synchronization Job between SharePoint and Luma Knowledge
Once the Data Sources and Data Objects are configured, the next step is to configure the Sync between your Sharepoint site and Luma Knowledge. Here, we map the Data Object in Source - Destination systems and configure the frequency at which the data sync is executed.
...
Navigate to the Manage Synchronization tab.
Click on the Add Sync Object button.
On the Configure Synchronization screen, add the following details:
Add Sync Job Name.
Add Description.
Set ‘Enable’to False. Once the sync job is configured and tested, we can enable the job.
Set 'Log Level' to Debug. This ensures the execution logs available for each sync run. The logs can be used to troubleshoot any errors with the sync.
In Push Data To (Data Destination), Select Luma Knowledge Data Source and Data Object information.
In Fetch Data From (Data Source), Select the Sharepoint Data Source and Data Object information.
Map Fields: Map the Data Object Fields in Sharepoint with Data Object Fields in Luma Knowledge. For each Destination Data Object Field, add the mappings as below:
For Destination Data Object Artifact, click on the Configure to add Custom Function - sharepointPrepareArtifactJSON. The function enables the system to read the documents from the Sharepoint site and create Artifacts in Luma Knowledge. Using the ‘sharepointPrepareArtifactJSON’ function, the documents are processed using the FAQ generation process. Luma Knowledge degenerates the document in QnA pairs and the artifact is created.
Update the following as required:Update ‘Category’ to the Domain in Knowledge Graph where the Artifact should be created.
Update ‘ArtifactState’ to the default Artifact state of the artifact.
Click Save.
Set Enable Validation Rules to Disable.
If you want to enable validation rules, set Enable Validation Rules to Enable. You mayadd a Custom Subroutine to Validation Rules to validate if the data record should be imported.
Once the details are added, Click the Save button.
The Sync Job is now ready.
Info |
---|
Using the ‘sharepointPrepareArtifactJSON’ function, the documents are processed using the FAQ generation process. If you want to process the documents and create artifacts using your organization-specific templates, the Custom Function should be created. You may get in touch with the Operations team or Serviceaide Support team to create the Custom function as per the custom template. |
Step 7: Test and Execute Synchronization
Once the data sync job is configured, you can now enable the sync and execute the job. The data sync can be executed manually or scheduled to run at a defined frequency using a CRON job.
...
On Manage Synchronization Jobs, select the Sharepoint-Luma Knowledge sync job (created in Step 5).
Click Edit to view the update details.
Set Enabled to True.
To manually execute the job,
Set the Frequency to One Time and click Save.
Now scroll down to the page and click Execute to trigger the job.
Alternatively, you may also execute the job from the Manage Synchronization Jobs tab. Select the job and click on Execute Sync Pair.
Upon successful completion of the job, you can view the details on Execution Logs.
On the Execution Logs, you can view the status of each execution.
Select the record to view the details on the documents imported and artifacts created. In the below example, 1 document was downloaded from SharePoint and uploaded into Luma Knowledge.
...