Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Creating cosmosdb client
var config = new ConfigurationBuilder().SetBasePath(context.FunctionAppDirectory)
.AddJsonFile("local.settings.json", optional: true, reloadOnChange: true)
.AddEnvironmentVariables()
.Build();
//1) initialize the cosmosdb client
using (DocumentClient client = new DocumentClient(new Uri(config["CosmosDB_Uri"]), config["CosmosDB_appKey"]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment