Integration with Azure Services

Learn how Cosmos DB can integrate with other Azure services to build better solutions in the least amount of time.


While Cosmos DB is a powerful tool, sometimes we might need to extend its capabilities by integrating it with other services. Luckily for us, if said services are in Azure, the integration is relatively easy, saving research, development time, and in some cases, money.

In this lesson, we’ll see just a few examples that might be handy on complex projects.

Azure Cognitive Search

Azure Cognitive Search is a fully customizable, smart search engine. This is particularly useful when searching the whole database since, in Cosmos DB, we are limited by partitions.

In a search service instance, we can create multiple indexes. When creating an index, we are asked the following:

  • A data source and a query:

    • We can select a Cosmos DB container

    • To get all new documents, we can use the following:

      • SELECT * FROM c WHERE c._ts > @HighWaterMark

  • Optional cognitive skills:

    • It uses AI for spell check and related words or topics

  • How to index each field:

    • Retrievable: If queries can return it

    • Filterable: If we can filter by its value

    • Sortable: If we can sort by it

    • Facetable: If we can group by it

    • Searchable: If we can have it

  • How frequently to index:

    • Once

    • Hourly

    • Daily

    • Custom

Shown below is a BlogPost container with the following document type:

Get hands-on with 1200+ tech skills courses.