Delete CosmosDB entry with Azure Functions v3.x

Dracon Interactive 26 Reputation points
2020-10-13T02:37:43.023+00:00

I have been searching for a technique to use Azure Functions to delete items in a Cosmos database, using the in-browser code editor. Theres various reasons on my side why I dont want to use locally-developed code on VS.

The code I am using is available here : [https://pastebin.com/Xr8t4X0X], I am using a HttpTrigger with a CosmosDB input and output binding. They are named fairly obviously (inputDocument, outputDocument).

This code is working amazingly for reading items from the db, and writing new documents, however I want to be able to delete a single item. I'm making an 'auction house' system, and to 'buy' an item, I need to remove it from the db.

I have searched a fair few places now, many people say to use DocumentDB / DocumentClient. I originally tried this with Microsoft.Azure.Documents.Client, however v3.x needed this to be changed to Microsoft.Azure.Documents.Core. This compiles correctly, however I am unable to find documentation on the use of .Core, even the links on its documentation reference to .Client.

Thanks.

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,862 questions
0 comments No comments
{count} votes

Accepted answer
  1. JayaC-MSFT 5,531 Reputation points
    2020-10-13T17:26:14.153+00:00
    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.