Skip to content

Instantly share code, notes, and snippets.

@justinyoo
Created February 18, 2018 12:39
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 justinyoo/8540f08c5d9d8fdc4e6cfc17802bc40a to your computer and use it in GitHub Desktop.
Save justinyoo/8540f08c5d9d8fdc4e6cfc17802bc40a to your computer and use it in GitHub Desktop.
Cosmos DB in Azure Functions V1 and V2
[FunctionName("ProductUpsertHttpTrigger")]
public static async Task<HttpResponseMessage> Run(
[HttpTrigger(AuthorizationLevel.Function, "post", Route = "products")] HttpRequestMessage req,
[DocumentDB(
databaseName: "%CosmosDbDdatabaseName%",
collectionName: "%CosmosDbCollectionName%")] IAsyncCollector<Product> collector,
TraceWriter log)
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment