• Not Answered

Azure PASS - Azure Search using Micorsoft.Azure.Search not working


In my current project, we are using Sitecore JSS with Azure PASS setup hence we have used default Azure search provider.

Our requirement is to expose indexed data to the external party hence we have created a few Azure functions to get data from Azure index using "Microsoft.Azure.Search".

Now the problem rise with full  index rebuild, After rebuild the Azure index name change from "Sitecore-web-index" to "Sitecore-web-index-XXX" and the Azure function is unaware of this change hence all code returns an error, however the problem fix when we do a double reindex as it now changes from "Sitecore-web-index-XXX" to "Sitecore-web-index".

With the above problem, we can't take forward on production.

I understand that Sitecore + Azure integration provided the zero downtime implementation by using the "<setting name="ContentSearch.Azure.SwitchOnRebuild" value="true"/>" but I believe this is only applicable to the roles within Sitecore what about the azure function or any WEB API which uses the "Microsoft.Azure.Search" to retrieve the azure data?


Any suggestions would be appreciated.

2 Replies

  • Hello Sachin,

    Please use Azure Rest API to get search index details from your Azure Function.


    Rest api : GET xxx.search.windows.net/indexes/index-catalog/docs?search=*&$filter=sitecorename eq 'sitecore_web_index'

    It should provide a JSON result - please use the key with indextype:"SEARCH"

    "value": [
    "@search.score": 1,
    "sitecorename": "sitecore_web_index",
    "indextype": "SEARCH",
    "servicename": "sitecore-web-index-815"
    "@search.score": 1,
    "sitecorename": "sitecore_web_index",
    "indextype": "REBUILD",
    "servicename": "sitecore-web-index"

    REFER: sitecore.stackexchange.com/.../4910