[Solved] An unhandled exception occurred while processing the request in cosmos db and asp.net core


The stack trace points to a NotFound in OperationType Read, ResourceType Collection. This means that the Uri that you are passing, is not pointing to a collection that exists in that account.

You are creating the Uri using:

UriFactory.CreateDocumentCollectionUri(_azureCosmosDbOptions.Value.DatabaseId, "catlogdb")

Check the value of _azureCosmosDbOptions.Value.DatabaseId and verify it is valid and it’s the one you expect, and double check if within that Account, there is a “catlogdb” collection within that database.

The repository link you provide in the comments does not match the code in your screenshots, there is no mention of catlogdb in that entire repository.

For the future, please do not post images, it makes it really hard to copy parts of your code to provide an answer.

3

solved An unhandled exception occurred while processing the request in cosmos db and asp.net core