Configure Cloud Hybrid Search In SharePoint Server 2016 And Office 365

It had been a long journey with C# Corner and it gives me immense please to publish my 150th article at C# Corner. Thanks to all the readers and the C# Corner Team for your support. In this article, we will see how to configure Cloud hybrid search in SharePoint Server 2016 and Office 365.

Cloud hybrid search facilitates the users to search for content, which exists in SharePoint 2016 On Premise Server along with the content search in Office 365. This is done by crawling the content in SharePoint 2016 Server and indexing it along with the search index in Office 365.

Image Source:

Before setting up Cloud hybrid search, we need to have prerequisites in SharePoint 2016 and Office 365 environment. Ensure the steps, mentioned below, are done.

  • A public domain has been registered with Office 365 (Refer here for the implementation).
  • A UPN prefix that matches the public domain has been added to the Local AD (Refer here for implementation).
  • An Active Azure Subscription is available (Refer here to see how to get $25 free Azure credits every month).
  • Office 365 AD is manageable from Azure (Refer here for implementation).
  • Synchronize Local Active Directory with Office 365 Directory (Refer here for implementation).

Once the steps, mentioned above are done, we can get started with Cloud hybrid search configuration, which involves two main steps, which are:

  • Create a Cloud Hybrid Search Service Application.
  • Connect your Cloud Search Service Application to your Office 365 tenant.

Microsoft has provided the two scripts, which automates both these steps. Both scripts will be downloaded as shown below.

Let’s head over to the Server, where we will be configuring the search. My farm configuration is such that I have created a Server (VM04-MINIROLE) as Search Mini Role to specifically set up search Service. The image, shown below, shows the working of Cloud hybrid search Service.

Image Source:

Create Cloud Search Service Application from UI

From the Manage Service Applications page, we can create the Cloud search Service Application through UI.

It is quite similar to the process of creating a normal search Service Application, except that we have to select an extra checkbox ‘Cloud Search Service Application’ to make the Service Application cater to cloud hybrid solution approach.

Though we can create the Service Application through UI, Search service creation and management is more stable when done through PowerShell. This is mainly due to the fact that, as per my personal experience, configuring search through UI sometimes takes longer and may even get stuck and never end.

Create Cloud Search Service Application through PowerShell

In order to create the Cloud Search Service Application, ensure that you have downloaded the script CreateCloudSSA.ps1 from here. Once you have the script downloaded to the Server, spin up SharePoint 2016 Management Shell as an administrator.

Navigate to the location, where you have stored the CreateCloudSSA.ps1 script and run it.

It will ask for a few parameters, which need to be supplied for the script to continue the execution. Once the parameters are supplied, it will automatically continue execution of the script.

  • SearchServerName
    Specify the SharePoint 2016 Server, where you are configuring the Search Service (VM04-MINIROLE,in my case).

  • SearchServiceAccount
    The Search service account in the format Domain\UserName will be used to configure the search Service (I have created a search Service account by the name SPFarmAccount. It is recommended to have a Service account specifically for Search Service).

  • SearchServiceAppName
    The name of the Cloud Search Service Application.

  • DatabaseServerName
    The name of the database Server in the SharePoint 2016 farm.

In case the Search Service Account is not added as a managed account, it will be automatically added as a managed account by the script. If prompted, add the credentials of the search Service account.

The Cloud search Service Application creation has started and this will take a few minutes to complete.

Once the Cloud Search Service Application is created, the next major step is to activate the topology, which is a time consuming step.

Finally, we will get the success message, which indicates that the Cloud search Service Application has been created.

Now, if we go to the list of Service Application page, we can see the newly created Cloud search Service Application.

Clicking on it will take you to the Cloud Search Administration page, where we can create content sources and configure other search related settings.

The Cloud search topology will be listed down in the same page. VM04-MINIROLE is the Server, where search has been configured and the various search Service components are activated. It will also add 4 databases in the SharePoint Database Server (VM02-SQL2016) as part of the Search Service Application creation.

Search Service Components

As shown in the above search configuration setup, SharePoint search architecture is made up of the three components, shown below.

  • Crawl and content processing
  • Index
  • Query processing
  • Search administration
  • Analytics

A successfully configured search Service will have all the components, mentioned above, working in unison. Each of the components will have a database created in SQL Server. On a high level, the crawl component is responsible for crawling SharePoint content and collects the crawl properties, which will in turn be sent to the content processing component. The content processing component receives the crawled properties, processes it and sends it to the Index component.

The index component receives the processed items from the content processing component and writes it to the search index. At the same time, it is responsible to return the results for a search query from the search index.

When the user inputs a search query and presses enter, the query is processed by the query component and is submitted to the Index component for the data retrieval from the search index.

Search administration component performs the overall administration of search like instantiating search Service instance and the related components.

Image Source: Microsoft MSDN

Connect your cloud Search service application to your Office 365 tenant

In order to complete the Cloud hybrid search set up, we have to connect the recently created Cloud search Service Application to the Office 365 tenant. Microsoft has provided the script to automate the onboarding of the Cloud search Service Application and Office 365 to Cloud hybrid search. You can get the script named Onboard-CloudHybridSearch.ps1 here.

In order to run the script, we have some prerequisites that need to be completed. Download and install the modules, mentioned below.

Install Microsoft Online Services Sign-In Assistant

First, download Microsoft Online Services Sign-In Assistant.

Select the 64 bit version.

Accept the agreement and click Install.

This would complete the setup of Microsoft Online Services Sign-in Assistant.

Install Azure Active Directory Module

Azure active directory module provides cmdlets for Azure AD administrative tasks like user and domain management. You can download the executable file here. Run the downloaded the Azure active directory module installation file.

Click Finish to complete the setup of Azure Active Directory.

Run the Onboarding Script

In order to complete the onboarding of Cloud search Service Application and Office 365 on to Cloud hybrid search, let’s go ahead and run the Onbaord-CloudHybridSearch.ps1 script.

It will ask for few parameters, which are required to input.

  • Portal URL
    Specify the SharePoint Online URL of the organization.

  • Administrator Credentials
    It will also ask for the Office 365 global administrator credentials
If asked, enter the Cloud search Service Application name.

This will complete the Onboarding process and will register the Cloud hybrid search.

Create a content source to crawl for cloud hybrid search

As a final step in configuring the Cloud hybrid search, we have to create a content source and run a full crawl in SharePoint 2016 On Premise Server. Clicking on the Cloud Search Service Application will open up the Search Administration page. Select content source in the left pane of the search administration page.

Click Create New Content Source. This will open up the page, where we can add the start address of the content source, which has to be crawled.

We can also specify the crawl schedules. We can set the schedules when the incremental and full crawls will take place in the Server.

The incremental crawl is scheduled to run after every 30 minutes.

The full crawl on the other hand runs every day at 12 AM.

The crawl schedules after configuration will look, as shown below.

Now, let’s go ahead and run a full crawl.

Since this is the first time, we are running the crawl, even if we click on incremental crawl, a full crawl will take place and the time taken will depend upon the amount of the content within the content source.

Once the crawl has completed, let's test the hybrid search scenario by going to SharePoint Online and search for IsExternalContent:1 .

‘IsExternalContent: 1’ is a property, which lists the search results only from the On Premise environment. This has listed search results from SharePoint 2016 On Premise Server in the SharePoint Online Search Page, which indicates a successful Hybrid Search Configuration.



Thus, we saw how to configure Cloud Hybrid Search in SharePoint 2016 and Office 365.

Similar Articles