I am looking for a way to upload a JSON file directly to my Azure Cosmos DB container. I am aware of the "classic" way doing it like:
- load the JSON file
- convert it via
JsonConvert.DeserializeObject<List<Item>>(data); - upload it like "
container.CreateItemAsync(item)"
I would like to skip the part where I have to deserialize the JSON and convert it into a C# object.
Is there a method or way like this?
container.CreateItemAsync(myData.json)
Microsoft.Azure.DocumentDB(old) orMicrosoft.Azure.Cosmos(new)?container.CreateItemStreamAsync(): learn.microsoft.com/en-us/dotnet/api/…CreateItemAsync<JObject>(). I don't think you can pass the JSON string directly, but a parsed JSON should work.