Skip to content

Instantly share code, notes, and snippets.

@sajeetharan
Last active June 18, 2019 07:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sajeetharan/788a6acf99416dde8e6ebd652c2b3ed2 to your computer and use it in GitHub Desktop.
Save sajeetharan/788a6acf99416dde8e6ebd652c2b3ed2 to your computer and use it in GitHub Desktop.
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