Skip to content

Instantly share code, notes, and snippets.

@ealsur
Created April 16, 2021 17:56
Show Gist options
  • Save ealsur/01b99715c98e11a6bd0ce7c4ea5e80dd to your computer and use it in GitHub Desktop.
Save ealsur/01b99715c98e11a6bd0ce7c4ea5e80dd to your computer and use it in GitHub Desktop.
Create and initialize CosmosClient
List<(string, string)> containers = new List<(string, string)>
{
("DatabaseNameForContainer1", "ContainerName1"),
("DatabaseNameForContainer2", "ContainerName2")
};
CosmosClientOptions cosmosClientOptions = new CosmosClientOptions
{
ApplicationName = "MyApplicationName",
// any other setting I want to customize
};
CosmosClient cosmosClient = await CosmosClient.CreateAndInitializeAsync(connectionString, containers, cosmosClientOptions);
@cannehag
Copy link

cannehag commented May 3, 2021

Yes, I went with that option instead. That works too :)
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment