-
Create an Azure Search service resource
Note that Azure Search support for Cosmos DB API for MongoDB is currently in preview. Before proceeding, you would need to raise a request to enable the preview feature and get it enabled. -
Import & index the Cosmos DB API for MongoDB data
- While setting up the data source, make sure the Cosmos DB account field looks like below: AccountEndpoint=https://.documents.azure.com;AccountKey=;ApiKind=MongoDb
- These are index attributes I chose for the current app

- The indexer will take a few minutes to finish crawling all the documents. You will be able to validate the indexer progress from the overview blade of the search service

-
Edit the SEARCH_API_KEY, SEARCH_API_ENDPOINT and SEARCH_INDEX_NAME variables in the Configuration > Application settings of the App service resource created by the deployment and then 'Save' the settings. That will apply the changes and restart the app.
- SEARCH_API_ENDPOINT is the Search service 'Url' you see in the Overview blade of the Search resource.
- SEARCH_API_KEY can be either of the keys available in the Search service > Keys blade.
- SEARCH_INDEX_NAME is the name of the Cosmos DB search index you created. You can see it from Search service Overview > Indexes tab.
Now you should be able to use the full text search functionality in the Cosmos Bookstore app!