I am developing a C# Azure Function and want to execute a stored procedure in Cosmos DB like the following:
string sprocName = "testSPROC";
int partitionId = contentJSON.partitionid;
RequestOptions requestOptions = new RequestOptions { PartitionKey = new PartitionKey(partitionId), EnableScriptLogging = true };
var sprocResponse = await client.ExecuteStoredProcedureAsync<Object>(
UriFactory.CreateStoredProcedureUri(databaseName, collectionName, sprocName),
contentJSON,
requestOptions);
The CosmosDB collection is partition by partitionid. But when I want to execute the stored procedure, it returns:
PartitionKey value must be supplied for this operation
Why?