Now a days, All the setup will be done on Azure (majorly) and so search will also be configured with Azure only.

Its a good facility comes from Microsoft and that could be used for any environment like UAT, DEV SIT or Prod.

With the use of Sitecore Azure template, all the Sitecore Instance setup will be done automatically (refer here) but to configure Azure search means use Azure search from your any of the Sitecore instance like DEV, UAT etc…, Just follow the below steps.

At first, Lets create Search App service in Azure.

Login into Azure Portal: https://portal.azure.com Create / Use existing Resource group and click on Add button to add Azure Search Service.

From 2nd step, search for the Azure Search template and click on the same.

Click on Create to create Azure Search App service

Once the template selected, specify the expected search url, subscription detail, Resource group for which you are creating this service, location and Pricing tier. Click on “Create” Button.

Once deployment will be finished, it will show the APP service as below.



Click on the APP Service will open the app service and from there you can get the detail about the URL.



Now your Azure Search service is created and the url for this demo is “https://samplexm.search.windows.net”

Now let us do the configuration of your local machine or any environment to use this Azure service.

You need to get 3 parameters to configure Azure search for your environment.

a) serviceUrl: it will be the HTTPS url of Search Service API. In our case it will be “https://samplexm.search.windows.net”.

b) apiVersion: Get the API version from the “Search Explorer”. from here, you can get the different version. Here is the reference for further.



c) apikey: get the Key from the portal. Copy the Primary Admin Key .

Add new connection string in your ConnectionString.config with the name “cloud.search”. example is as below. <add name="cloud.search" connectionString="serviceUrl= <url> ;apiVersion= <apiVersion> ;apiKey= <apiKey> " /> If you have multiple Azure search service, add the same with “|” separation. <add name = "cloud.search" connectionString = "serviceUrl=https://searchservice1.search.windows.net;apiVersion=2015-02-28;apiKey=AdminKey1|serviceUrl=https://searchservice2.search.windows.net;apiVersion=2015-02-28;apiKey=AdminKey2" /> For any analytics detail, you will need to add another connection string with the name “cloud.search.analytics” and that should be specified in respective Index configuration. Open web.config of respective environment and change the setting “search:define” to “Azure”. This will automatically switch the configuration of search to Azure.



Once these settings are done, just go to Control panel on Launch pad and click on rebuild the index. This will generate all the index depends upon the settings you have selected like for Sitecore XM instance, there will be 4 indexes only and for Sitecore XP, it will be more.



Now all yours… go ahead and consume this search service for showing search results.

There are many Features of Azure Search And Limitations of Azure search which you can refer.

Happy Azuring!!

References:

https://doc.sitecore.net/sitecore_experience_platform/setting_up_and_maintaining/search_and_indexing/sitecore_azure_search_overview

https://doc.sitecore.net/sitecore_experience_platform/setting_up_and_maintaining/search_and_indexing/configure_azure_search