You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/cosmos-db/nosql/how-to-create-multiple-cosmos-db-triggers.md
+21-22Lines changed: 21 additions & 22 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ author: ealsur
5
5
ms.service: cosmos-db
6
6
ms.subservice: nosql
7
7
ms.topic: how-to
8
-
ms.date: 07/17/2019
8
+
ms.date: 04/07/2023
9
9
ms.author: maquaran
10
10
ms.devlang: csharp
11
11
ms.custom: devx-track-csharp
@@ -37,16 +37,15 @@ The goal of this article is to guide you to accomplish the second option.
37
37
38
38
## Configuring a shared leases container
39
39
40
-
To configure the shared leases container, the only extra configuration you need to make on your triggers is to add the `LeaseCollectionPrefix`[attribute](../../azure-functions/functions-bindings-cosmosdb-v2-trigger.md#attributes) if you are using C# or `leaseCollectionPrefix`[attribute](../../azure-functions/functions-bindings-cosmosdb-v2-trigger.md) if you are using JavaScript. The value of the attribute should be a logical descriptor of what that particular trigger.
40
+
To configure the shared leases container, the only extra configuration you need to make on your triggers is to add the `LeaseContainerPrefix`[attribute](../../azure-functions/functions-bindings-cosmosdb-v2-trigger.md#attributes) if you are using C# or `leaseContainerPrefix`[attribute](../../azure-functions/functions-bindings-cosmosdb-v2-trigger.md) if you are using JavaScript. The value of the attribute should be a logical descriptor of what that particular trigger.
41
41
42
-
For example, if you have three Triggers: one that sends emails, one that does an aggregation to create a materialized view, and one that sends the changes to another storage, for later analysis, you could assign the `LeaseCollectionPrefix` of "emails" to the first one, "materialized" to the second one, and "analytics" to the third one.
42
+
For example, if you have three Triggers: one that sends emails, one that does an aggregation to create a materialized view, and one that sends the changes to another storage, for later analysis, you could assign the `LeaseContainerPrefix` of "emails" to the first one, "materialized" to the second one, and "analytics" to the third one.
43
43
44
44
The important part is that all three Triggers **can use the same leases container configuration** (account, database, and container name).
45
45
46
-
A very simple code samples using the `LeaseCollectionPrefix` attribute in C#, would look like this:
46
+
A very simple code samples using the `LeaseContainerPrefix` attribute in C#, would look like this:
47
47
48
48
```cs
49
-
usingMicrosoft.Azure.Documents;
50
49
usingMicrosoft.Azure.WebJobs;
51
50
usingMicrosoft.Azure.WebJobs.Host;
52
51
usingSystem.Collections.Generic;
@@ -55,10 +54,10 @@ using Microsoft.Extensions.Logging;
0 commit comments