Skip to content

Commit 77b23e7

Browse files
authored
Merge pull request #201856 from kshyju/patch-2
Adding cosmos input binding sample for dotnet isolated
2 parents b3aae01 + 5a138a7 commit 77b23e7

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

articles/azure-functions/functions-bindings-cosmosdb-v2-input.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,24 @@ namespace CosmosDBSamplesV2
423423

424424
# [Isolated process](#tab/isolated-process)
425425

426-
Example pending.
426+
This section contains examples that require version 3.x of Azure Cosmos DB extension and 5.x of Azure Storage extension. If not already present in your function app, add reference to the following NuGet packages:
427+
428+
* [Microsoft.Azure.Functions.Worker.Extensions.CosmosDB](https://www.nuget.org/packages/Microsoft.Azure.Functions.Worker.Extensions.CosmosDB/3.0.9)
429+
* [Microsoft.Azure.Functions.Worker.Extensions.Storage.Queues](https://www.nuget.org/packages/Microsoft.Azure.Functions.Worker.Extensions.Storage.Queues/5.0.0)
430+
431+
* [Queue trigger, look up ID from JSON](#queue-trigger-look-up-id-from-json-isolated)
432+
433+
The examples refer to a simple `ToDoItem` type:
434+
435+
:::code language="csharp" source="~/azure-functions-dotnet-worker/samples/Extensions/CosmosDB/CosmosDbInputBindingFunction.cs" id="docsnippet_qtrigger_with_cosmosdb_inputbinding_todo_model" :::
436+
437+
<a id="queue-trigger-look-up-id-from-json-isolated"></a>
438+
439+
### Queue trigger, look up ID from JSON
440+
441+
The following example shows a function that retrieves a single document. The function is triggered by a JSON message in the storage queue. The queue trigger parses the JSON into an object of type `ToDoItemLookup`, which contains the ID and partition key value to retrieve. That ID and partition key value are used to return a `ToDoItem` document from the specified database and collection.
442+
443+
:::code language="csharp" source="~/azure-functions-dotnet-worker/samples/Extensions/CosmosDB/CosmosDbInputBindingFunction.cs" id="docsnippet_qtrigger_with_cosmosdb_inputbinding" :::
427444

428445
# [C# Script](#tab/csharp-script)
429446

0 commit comments

Comments
 (0)