Hello, @Nguyen Minh Thong - Could you make sure that there is an actual matching item in the CosmosDB and try again? The correct expression for the "id" and "partitionKey" is {id}
for both input and output bindings.
The tutorial seems to have gone a bit out of date on this aspect of the configuration or could probably communicate the configuration and its common pitfalls better. Based on the issues surrounding this tutorial that were reported in the past (which are listed at the bottom of this answer), the Notfoundmessage error is caused by the following two factors:
- The actual matching item not being present in the CosmosDB. This should typically be handled gracefully in the solution without throwing runtime errors.
- Binding configuration, specifically between
containerName
vscollectionName
, may vary depending on the version of Functions runtime/CosmosDB Extension version you're using. Please review the Azure Cosmos DB trigger for Azure Functions 2.x and higher doc thoroughly for the right configuration for your setup.
Similar posts:
- https://learn.microsoft.com/en-us/answers/questions/1345746/how-to-resolve-internal-service-error-with-cosmosd
- https://learn.microsoft.com/en-us/answers/questions/1371229/chain-azure-functions-together-using-input-and-out
- https://github.com/Azure/Azure-Functions/issues/1670
- https://github.com/Azure/azure-functions-host/issues/9566
Please "Accept Answer" if the answer is helpful so that others in the community may benefit from your experience.