Azure Cognitive Search now supports swapping indexes
Published Jun 30 2022 04:59 PM 6,852 Views

Search indexes are immutable, which means if you need to update your index, you’ll often need to drop and rebuild your index or create a new index and then migrate your application over. Swapping search indexes like this adds complexity to managing a search index and can be difficult if you end up needing to update application settings in multiple places or if you need to redeploy your code.


To help make swapping indexes easier, Azure Cognitive Search now supports index aliases, available in preview. An alias is a secondary name that can be used to reference an index for querying, indexing, and other document operations. You can create aliases via the REST API, Visual Studio Code extension, or the SDK.


POST https://[service name]

"name": "my-alias",
"indexes": ["hotel-samples-index"]


If you find yourself updating your search indexes fairly frequently, you’ll probably benefit from using aliases. The diagram below shows the typical workflow for using index aliases with your application.

Figure 1. The workflow for using an index alias with your applicationFigure 1. The workflow for using an index alias with your application

Index aliases are supported by all document operations which include the following APIs:


To get started, check out our documentation on how to create an index alias.

Version history
Last update:
‎Jul 18 2023 09:40 AM
Updated by: