Nicolas Fromme Thanks for posting your question in Microsoft Q&A. As per doc: Azure Cosmos DB trigger for Azure Functions 2.x and higher, the trigger uses the Azure Cosmos DB change feed to listen for inserts and updates across partitions but doesn't include updates for deletions. Hence, you would need to use cosmos SDK as suggested by Sajeetharan.
From the description above, it appears that you would like to perform it via in-portal development. Here are the steps you can follow:
- Select Advanced Tools -> Go option in the azure portal to open Kudu console and then choose CMD from Debug console option at the top.
- Then navigate to C:\home\site\wwwroot directory and install https://www.npmjs.com/package/@azure/cosmos library with the below command (
npm install @azure/cosmos
):

That should create package.json
file which includes cosmos package with the latest supported version, and you can perform delete operation inside the function like below:
const { CosmosClient } = require("@azure/cosmos");
module.exports = async function (context, req) {
context.log('JavaScript HTTP trigger function processed a request.');
const name = (req.query.name || (req.body && req.body.name));
const responseMessage = name
? "Hello, " + name + ". This HTTP triggered function executed successfully."
: "This HTTP triggered function executed successfully. Pass a name in the query string or in the request body for a personalized response.";
const endpoint = process.env.COSMOS_ENDPOINT;
const key = process.env.COSMOS_KEY;
const databaseId = process.env.COSMOS_DATABASE_ID;
const containerId = process.env.COSMOS_CONTAINER_ID;
const client = new CosmosClient({ endpoint, key });
const container = client.database(databaseId).container(containerId);
const itemId = "your-item-id";
const partitionKey = "your-partition-key";
const { resource } = await container.item(itemId, partitionKey).delete();
context.res = {
// status: 200, /* Defaults to 200 */
body: responseMessage
};
}
Note the above code snippet is just for reference and please make changes for your scenario accordingly. More code samples and usage about the package can be found in https://www.npmjs.com/package/@azure/cosmos.
I hope this helps and let me know if you have any questions.
If you found the answer to your question helpful, please take a moment to mark it as Yes
for others to benefit from your experience. Or simply add a comment tagging me and would be happy to answer your questions.