Skip to content

Instantly share code, notes, and snippets.

@justinyoo
Created February 18, 2018 12:39
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save justinyoo/2e8f58b30774b3a381995c7b1ab07b89 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")] HttpRequest req,
[CosmosDB(
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