Cannot create vector index in Azure CosmosDB for MongoDB vCore

Peter Pölzl 0 Reputation points
2025-06-25T19:49:56.3533333+00:00

I'm trying to create a vector index in my free tier Azure CosmosDB for MongoDB vCore in location "France Central". I get an error. The same query runs to completion in a Azure CosmosDB for MongoDB vCore database with M10 SKU in another location.

I have a collection named "documents" with a field named "embeddings", which is a 1536-dimensional vector of floats. I'm trying to create the index using mongodb shell. Here is my query:

db.runCommand({
createIndexes: 'documents',
  indexes: [
    {
      name: 'vectorSearchIndex',
      key: {
        "embedding": "cosmosSearch"
      },
      cosmosSearchOptions: {
        kind: 'vector-ivf',
        numLists: 5,
        similarity: 'COS',
        dimensions: 1536
      }
    }
  ]
});

I get back an internal error like:

MongoServerError[InternalError]: [ActivityId=9545a0fa-cb92-30a1-6d57-90bd06000000] Index Creation failed
Azure Cosmos DB
Azure Cosmos DB
An Azure NoSQL database service for app development.
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.