Search code examples
azure-cognitive-search

Is it possible to export an Azure Search index schema?


Is it possible to export an index schema ?

I'm looking for best practices on how to create the same index schema into different staging areas (Dev, Test, Prod).

I can't find any export in the portal, so I guess the recommended approach is to always create an index using a script/sdk, so it can be applied to other areas ?


Solution

  • Currently the only way to do this is via the Azure Search REST API or .NET SDK. It is not possible to export the index definition via the Azure portal. Please vote on this UserVoice item to help us prioritize.

    As an example of how to do this with the REST API, to get the schema you can simply do a GET request on the index. For example: GET https://myservice.search.windows.net/indexes/myindex. You can also take this result as-is and then do a PUT or POST to create the index with this result in the body.