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/change-feed-functions.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,7 @@ Azure Functions provides the simplest way to connect to the [change feed](change
15
15
16
16

17
17
18
-
With the [Azure Functions trigger for Cosmos DB](../azure-functions/functions-bindings-cosmosdb-v2.md#trigger), you can leverage the [Change Feed Processor](./change-feed-processor.md)'s scaling and reliable event detection functionality without the need to maintain any [worker infrastructure](./change-feed-processor.md). Just focus on your Azure Function's logic without worrying about the rest of the event-sourcing pipeline. You can even mix the Trigger with any other [Azure Functions bindings](../azure-functions/functions-triggers-bindings.md#supported-bindings).
18
+
With the [Azure Functions trigger for Cosmos DB](../azure-functions/functions-bindings-cosmosdb-v2-trigger.md), you can leverage the [Change Feed Processor](./change-feed-processor.md)'s scaling and reliable event detection functionality without the need to maintain any [worker infrastructure](./change-feed-processor.md). Just focus on your Azure Function's logic without worrying about the rest of the event-sourcing pipeline. You can even mix the Trigger with any other [Azure Functions bindings](../azure-functions/functions-triggers-bindings.md#supported-bindings).
19
19
20
20
> [!NOTE]
21
21
> Currently, the Azure Functions trigger for Cosmos DB is supported for use with the Core (SQL) API only.
@@ -25,7 +25,7 @@ With the [Azure Functions trigger for Cosmos DB](../azure-functions/functions-bi
25
25
To implement a serverless event-based flow, you need:
26
26
27
27
***The monitored container**: The monitored container is the Azure Cosmos container being monitored, and it stores the data from which the change feed is generated. Any inserts, updates to the monitored container are reflected in the change feed of the container.
28
-
***The lease container**: The lease container maintains state across multiple and dynamic serverless Azure Function instances and enables dynamic scaling. This lease container can be manually or automatically created by the Azure Functions trigger for Cosmos DB. To automatically create the lease container, set the *CreateLeaseCollectionIfNotExists* flag in the [configuration](../azure-functions/functions-bindings-cosmosdb-v2.md#trigger---configuration). Partitioned lease containers are required to have a `/id` partition key definition.
28
+
***The lease container**: The lease container maintains state across multiple and dynamic serverless Azure Function instances and enables dynamic scaling. This lease container can be manually or automatically created by the Azure Functions trigger for Cosmos DB. To automatically create the lease container, set the *CreateLeaseCollectionIfNotExists* flag in the [configuration](../azure-functions/functions-bindings-cosmosdb-v2-trigger.md#configuration). Partitioned lease containers are required to have a `/id` partition key definition.
29
29
30
30
## Create your Azure Functions trigger for Cosmos DB
Copy file name to clipboardExpand all lines: articles/cosmos-db/how-to-configure-cosmos-db-trigger-connection-policy.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,7 +18,7 @@ There are two connection modes - Direct mode and Gateway mode. To learn more abo
18
18
19
19
## Changing the connection mode and protocol
20
20
21
-
There are two key configuration settings available to configure the client connection policy – the **connection mode** and the **connection protocol**. You can change the default connection mode and protocol used by the Azure Functions trigger for Cosmos DB and all the [Azure Cosmos DB bindings](../azure-functions/functions-bindings-cosmosdb-v2.md#output)). To change the default settings, you need to locate the `host.json` file in your Azure Functions project or Azure Functions App and add the following [extra setting](../azure-functions/functions-bindings-cosmosdb-v2.md#hostjson-settings):
21
+
There are two key configuration settings available to configure the client connection policy – the **connection mode** and the **connection protocol**. You can change the default connection mode and protocol used by the Azure Functions trigger for Cosmos DB and all the [Azure Cosmos DB bindings](../azure-functions/functions-bindings-cosmosdb-v2-output.md)). To change the default settings, you need to locate the `host.json` file in your Azure Functions project or Azure Functions App and add the following [extra setting](../azure-functions/functions-bindings-cosmosdb-v2.md#hostjson-settings):
Copy file name to clipboardExpand all lines: articles/cosmos-db/how-to-create-multiple-cosmos-db-triggers.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -33,7 +33,7 @@ The goal of this article is to guide you to accomplish the second option.
33
33
34
34
## Configuring a shared leases container
35
35
36
-
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.md#trigger---attributes-and-annotations) if you are using C# or `leaseCollectionPrefix`[attribute](../azure-functions/functions-bindings-cosmosdb-v2.md#trigger) if you are using JavaScript. The value of the attribute should be a logical descriptor of what that particular trigger.
36
+
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-and-annotations) if you are using C# or `leaseCollectionPrefix`[attribute](../azure-functions/functions-bindings-cosmosdb-v2.md#trigger) if you are using JavaScript. The value of the attribute should be a logical descriptor of what that particular trigger.
37
37
38
38
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.
39
39
@@ -103,6 +103,6 @@ And for JavaScript, you can apply the configuration on the `function.json` file,
103
103
104
104
## Next steps
105
105
106
-
* See the full configuration for the [Azure Functions trigger for Cosmos DB](../azure-functions/functions-bindings-cosmosdb-v2.md#trigger---configuration)
107
-
* Check the extended [list of samples](../azure-functions/functions-bindings-cosmosdb-v2.md#trigger) for all the languages.
106
+
* See the full configuration for the [Azure Functions trigger for Cosmos DB](../azure-functions/functions-bindings-cosmosdb-v2-trigger.md#configuration)
107
+
* Check the extended [list of samples](../azure-functions/functions-bindings-cosmosdb-v2-trigger.md) for all the languages.
108
108
* Visit the Serverless recipes with Azure Cosmos DB and Azure Functions [GitHub repository](https://github.com/ealsur/serverless-recipes/tree/master/cosmosdbtriggerscenarios) for more samples.
Copy file name to clipboardExpand all lines: articles/cosmos-db/troubleshoot-changefeed-functions.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -61,7 +61,7 @@ This scenario can have multiple causes and all of them should be checked:
61
61
62
62
1. Is your Azure Function deployed in the same region as your Azure Cosmos account? For optimal network latency, both the Azure Function and your Azure Cosmos account should be colocated in the same Azure region.
63
63
2. Are the changes happening in your Azure Cosmos container continuous or sporadic?
64
-
If it's the latter, there could be some delay between the changes being stored and the Azure Function picking them up. This is because internally, when the trigger checks for changes in your Azure Cosmos container and finds none pending to be read, it will sleep for a configurable amount of time (5 seconds, by default) before checking for new changes (to avoid high RU consumption). You can configure this sleep time through the `FeedPollDelay/feedPollDelay` setting in the [configuration](../azure-functions/functions-bindings-cosmosdb-v2.md#trigger---configuration) of your trigger (the value is expected to be in milliseconds).
64
+
If it's the latter, there could be some delay between the changes being stored and the Azure Function picking them up. This is because internally, when the trigger checks for changes in your Azure Cosmos container and finds none pending to be read, it will sleep for a configurable amount of time (5 seconds, by default) before checking for new changes (to avoid high RU consumption). You can configure this sleep time through the `FeedPollDelay/feedPollDelay` setting in the [configuration](../azure-functions/functions-bindings-cosmosdb-v2-trigger.md#configuration) of your trigger (the value is expected to be in milliseconds).
65
65
3. Your Azure Cosmos container might be [rate-limited](./request-units.md).
66
66
4. You can use the `PreferredLocations` attribute in your trigger to specify a comma-separated list of Azure regions to define a custom preferred connection order.
67
67
@@ -88,10 +88,10 @@ One easy way to workaround this situation, is to apply a `LeaseCollectionPrefix/
88
88
To re-process all the items in a container from the beginning:
89
89
1. Stop your Azure function if it is currently running.
90
90
1. Delete the documents in the lease collection (or delete and re-create the lease collection so it is empty)
91
-
1. Set the [StartFromBeginning](../azure-functions/functions-bindings-cosmosdb-v2.md#trigger---configuration) CosmosDBTrigger attribute in your function to true.
91
+
1. Set the [StartFromBeginning](../azure-functions/functions-bindings-cosmosdb-v2-trigger.md#configuration) CosmosDBTrigger attribute in your function to true.
92
92
1. Restart the Azure function. It will now read and process all changes from the beginning.
93
93
94
-
Setting [StartFromBeginning](../azure-functions/functions-bindings-cosmosdb-v2.md#trigger---configuration) to true will tell the Azure function to start reading changes from the beginning of the history of the collection instead of the current time. This only works when there are no already created leases (i.e. documents in the leases collection). Setting this property to true when there are leases already created has no effect; in this scenario, when a function is stopped and restarted, it will begin reading from the last checkpoint, as defined in the leases collection. To re-process from the beginning, follow the above steps 1-4.
94
+
Setting [StartFromBeginning](../azure-functions/functions-bindings-cosmosdb-v2-trigger.md#configuration) to true will tell the Azure function to start reading changes from the beginning of the history of the collection instead of the current time. This only works when there are no already created leases (i.e. documents in the leases collection). Setting this property to true when there are leases already created has no effect; in this scenario, when a function is stopped and restarted, it will begin reading from the last checkpoint, as defined in the leases collection. To re-process from the beginning, follow the above steps 1-4.
95
95
96
96
### Binding can only be done with IReadOnlyList\<Document> or JArray
97
97
@@ -101,7 +101,7 @@ To workaround this situation, remove the manual NuGet reference that was added a
101
101
102
102
### Changing Azure Function's polling interval for the detecting changes
103
103
104
-
As explained earlier for [My changes take too long to be received](./troubleshoot-changefeed-functions.md#my-changes-take-too-long-to-be-received), Azure function will sleep for a configurable amount of time (5 seconds, by default) before checking for new changes (to avoid high RU consumption). You can configure this sleep time through the `FeedPollDelay/feedPollDelay` setting in the [configuration](../azure-functions/functions-bindings-cosmosdb-v2.md#trigger---configuration) of your trigger (the value is expected to be in milliseconds).
104
+
As explained earlier for [My changes take too long to be received](./troubleshoot-changefeed-functions.md#my-changes-take-too-long-to-be-received), Azure function will sleep for a configurable amount of time (5 seconds, by default) before checking for new changes (to avoid high RU consumption). You can configure this sleep time through the `FeedPollDelay/feedPollDelay` setting in the [configuration](../azure-functions/functions-bindings-cosmosdb-v2-trigger.md#configuration) of your trigger (the value is expected to be in milliseconds).
0 commit comments