I was getting a similar error and found that I had an invalid Partition Key Path when I created a collection of documents, as shown in the collectionDefinition.PartitionKey.Paths.Add("/LastName") below. My ExecuteStoredProcedure RequestOption does not match the field that I selected in new RequestOptions { PartitionKey = new PartitionKey("matchingLastNameSelectionHere") } . Hope this helps.
private static async Task<DocumentCollection> CreateCollectionAsync(string dbLink, string id) { DocumentCollection collectionDefinition = new DocumentCollection { Id = id }; collectionDefinition.IndexingPolicy = new IndexingPolicy(new RangeIndex(DataType.String) { Precision = -1 }); collectionDefinition.PartitionKey.Paths.Add("/LastName"); return await _client.CreateDocumentCollectionAsync( dbLink, collectionDefinition, new RequestOptions { OfferThroughput = 400 }); }
Execute code
await client.ExecuteStoredProcedureAsync<DeviceSignal>(UriFactory.CreateStoredProcedureUri("db", "coll", "SetLatestStateAcrossReadings"), new RequestOptions { PartitionKey = new PartitionKey("matchingLastNameSelectionHere") }, sprocsParams);
source share