Extend Microsoft Search With Azure SQL Graph Connector

Introduction 

 
Microsoft Search shows the content that your organization has stored in Microsoft 365 Tenant or indexed through connectors.
 
Microsoft Graph connectors can index third-party data to appear in Microsoft Search results. The third-party data can be hosted on-premises or in the public or private clouds. Connectors expand the types of content sources that are searchable in your Microsoft 365 productivity apps and the broader Microsoft ecosystem.
 
In this article, Let's understand how to index "Azure SQL" data using Graph Connector into Microsoft Search Results.
 
Extend Microsoft Search With Azure SQL Graph Connector
 
License requirements
 
To view data from connectors in your search results, users must have one of the following Microsoft 365 or Office 365 subscriptions:
  • Microsoft 365 or Office 365 Enterprise E3 or E5
  • Microsoft 365 or Office 365 Education A3 or A5
Let's start with the configuration steps.
 
Step 1 - Navigate to Connectors
  1. Go to Microsoft 365 admin center.
  2. In the navigation pane, go to Settings.
  3. Select > Microsoft Search.
  4. Select > Connectors
  5. Select > + Add
Extend Microsoft Search With Azure SQL Graph Connector
 
Step 2 - Select Azure SQL as a data source
 
Microsoft has seven connectors available to connect with external data sources and several partners released connectors to connect with an external data source. 
 
Extend Microsoft Search With Azure SQL Graph Connector
 
Step 3 - Fill connection name details
  • Name (mandatory)
  • Connection Id (mandatory)
  • Description (Optional) 
Extend Microsoft Search With Azure SQL Graph Connector
 
Step 4 - Configure Database settings
  • I already have Azure SQL in place, So I used the same to connect
  • Server > Azure SQL Server Name
  • Database > Azure SQL Database name
  • Credentials -> Basic (for this article purpose)
  • Click the Test Connection, On succeed > click next.
Extend Microsoft Search With Azure SQL Graph Connector
 
Step 5 - Configure Full Crawl Setting
 
Navigate to the Azure SQL Database table and create a SQL query, which will be used to get data. The full crawl selects all the columns or properties you want to be made queryable, searchable, or retrievable
 
Importance of watermark 
 
To prevent overloading the database, the connector batches and resumes full-crawl queries with a full-crawl watermark column. By using the value of the watermark column, each subsequent batch is fetched, and querying is resumed from the last checkpoint. Essentially this is a mechanism to control data refresh for full crawls.
 
Example:
 
WHERE (FlightId> @watermark). watermark column name with the reserved keyword @watermark. If the sort order of the watermark column is ascending, use >; otherwise, use <.
 
ORDER BY CreatedDateTime ASC. Sort on the watermark column in ascending or descending order.
 
Extend Microsoft Search With Azure SQL Graph Connector
 
Step 6 - Configure Incremental Crawl Setting 
 
With this query, the SQL connector determines any changes to the data since the last incremental crawl. As in the full crawl, select all columns that you want to be made queryable, searchable, or retrievable. Specify the same set of ACL columns that you specified in the full crawl query.
 
Extend Microsoft Search With Azure SQL Graph Connector
 
Step 7 - Configure Incremental Crawl Setting
 
You can choose which column can be set as Querable, Searchable & Retrieve, It is standard schema configuration as SharePoint Search. 
 
Extend Microsoft Search With Azure SQL Graph Connector
 
Step 8 - Manage Search Permission
 
You can choose to use the ACLs specified in the full crawl screen or you can override them to make your content visible to everyone 
 
Extend Microsoft Search With Azure SQL Graph Connector
 
Step 9 - Content Refresh Settings
 
You can configure the incremental and full refresh interval.
 
Extend Microsoft Search With Azure SQL Graph Connector
 
Step 10 - Review connection and complete
 
All defined configurations can be reviewed and modified here. Once it complete, click to finish to proceed.
 
Extend Microsoft Search With Azure SQL Graph Connector
 
Step 11 - Review connection and complete
 
Wait for a couple of minutes, connection content will full crawl and the connection state will also change from Publishing to Ready. Once the connection state will be ready, two actions need to be performed in sequence.
  1. Create a Result Source.
  2. Create a Vertical. 
Extend Microsoft Search With Azure SQL Graph Connector
 
Step 12 - Result Type Section
 
Once you select create result type, It will simple steps to follow a naming convention, like enter the result type name:
 
Extend Microsoft Search With Azure SQL Graph Connector
 
Step 13 - Result Type Content Source
 
Select the appropriate content source so that crawled or configured data can be mapped properly. 
 
Extend Microsoft Search With Azure SQL Graph Connector
 
Step 14 - Result Type Rule
 
Define the rules for result type is optional but you can define the filter or other criteria to exclude or include the results.
 
Extend Microsoft Search With Azure SQL Graph Connector
 
Step 15 - Design Layout
 
These are the important steps, how you can design your layout or adaptive rich card, which will be rendered into search results.
 
Once you click "Launch Layout Designer", it will navigate to https://searchlayoutdesigner.azurewebsites.net/
 
Extend Microsoft Search With Azure SQL Graph Connector
 
Step 16 - Search Layout Designer
 
Select a blank layout and design the required card.
 
Copy content from Layout Payload editor and paste into step no. 15. 
 
Extend Microsoft Search With Azure SQL Graph Connector
 
Layout payload editor added to GitHub link here
 
Step 17 - Review the result type settings
 
Review the result type configuration and proceed to Vertical creation to map with a defined result type. 
 
Extend Microsoft Search With Azure SQL Graph Connector
 
Manage Vertical
 
Verticals make it easier for users to find the information that they have permission to see.
 
You can add search verticals that are relevant to your organization. These will appear on the Microsoft Search results page in SharePoint, Office, and Bing
 
Before you start, make sure that the connector has been indexed. This can take up to 48 hours, depending on the file size.
 
You can’t create a vertical for content that resides in SharePoint.
 
There are three basic steps to add a vertical:
  1. Create the vertical. In this step, you define the vertical’s name, content source, and scope of the content to search.
  2. Define what the results for this vertical will look like.
  3. Enable the vertical (to be displayed) from the vertical list page.
Step 18 - Create a Vertical
 
In the navigation pane, go to custom connector, and then select the Verticals Link.
 
To add a vertical, select Add. Or, to edit a vertical, select it in the list.
 
Remember, verticals are created in a disabled state. They must be enabled before users can see them
 
Extend Microsoft Search With Azure SQL Graph Connector
 
Step 19 - Connect Vertical with Content Source
 
Extend Microsoft Search With Azure SQL Graph Connector
Step 20 - Add Query (Optional)
 
You can add a KQL query, It will help to filter the result further to the result set. 
 
Extend Microsoft Search With Azure SQL Graph Connector
 
Outcome
 
Use the Microsoft Search results page in SharePoint, Office, and Bing, Navigate to respective vertical to get external items result.
 
Extend Microsoft Search With Azure SQL Graph Connector
 
Limitations
  • Indexing rich content inside database columns is not supported. Examples of such content are HTML, JSON, XML, blobs, and document parsings that exist as links inside the database columns.
I hope you have enjoyed and learned something new in this article. Thanks for reading and stay tuned for the next article.


Similar Articles