How to update DocumentDb from Microsoft.Azure.DocumentDB.Core



As we are updating our code base from netcoreapp3.1 to net5.0, one of the thing we have to do is update the Azure SDK we are using (KeyVault / Blob / Cosmos / ...)
This question is about the CosmosDb part as we are consuming is with DocumentDb using SQL query

As of today we use Microsoft.Azure.DocumentDB.Core
The nuget page indicate that the documentation is here :
The first link point to this page : which indicate to use the nuget Microsoft.Azure.Cosmos

The Azure Sdk team effort seems to rename everything from Microsoft.Azure.Foo to Azure.Foo so I'm not very about that one, also I see this :

So the docs on the left point to the v4 SDK which seems to be the "target", and has been renamed to Azure.Cosmos
Though when I try to reference this one, I'm not sure yet where to find the replacement for few piece of code by reading the "release note"

Here is a very small example of one portion of the code I'm not sure how to udpate :

I suppose I'll be able to re-write everything using this page :

I suppose the various link are not up to date yet and point to v2 or v3 ?

Azure Cosmos DB
Azure Cosmos DB
An Azure NoSQL database service for app development.
1,363 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Anurag Sharma 17,536 Reputation points

    Hi @HERTOGS Alexandre (EXT) GbsuCldDit , welcome to Microsoft Q&A forum.

    Thanks for providing such a detailed analysis an yes you are correct in mentioning that some code piece could still be corrected with respect to v4 and as there is lot of documentation available already, the internal team keeps on updating them as and when we notice or someone points out.

    The link provided above is a good start if you want to rewrite code and has a very clear and detailed description of implementing basic code scenarios. If you face any trouble with them, we would be delighted to help you out on the same. Below are some more article you can refer to, you can start with Main method.


    Again, we appreciate your efforts for feedback.