Skip to content

Instantly share code, notes, and snippets.

@ealsur
Created October 21, 2022 22:19
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 ealsur/913387a2414efaf4a5670c26dc55baea to your computer and use it in GitHub Desktop.
Save ealsur/913387a2414efaf4a5670c26dc55baea to your computer and use it in GitHub Desktop.
Azure Functions CosmosClient binding
[FunctionName("DocsByUsingCosmosClient")]
public static async Task<IActionResult> Run(
[HttpTrigger(AuthorizationLevel.Anonymous, "get", "post",
Route = null)]HttpRequest req,
[CosmosDB(
databaseName: "ToDoItems",
containerName: "Items",
Connection = "CosmosDBConnection")] CosmosClient client,
ILogger log) {
// use the client to execute any SDK supported operation
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment