Search code examples
.netindexingazure-cosmosdb

Completely replace an indexing JSON in Cosmos DB using the .NET API


How could I completely replace an indexing JSON in Cosmos DB using the .NET API?

I am aware of this API, but I would like to have a JSON file locally and just put its contents into an indexing policy using the .NET API. Is it possible somehow?


Solution

  • The two ways you could update Index Policies are using

    • SDK
    • Azure Portal

    Currently there is no way to replace the whole contents as you asked in the question. However you could use ARM template with Index Policy which lets you to define in JSON format to update it.