Skip to content

Commit 443bc89

Browse files
authored
Merge pull request #84227 from deborahc/dech-changefeed-docs
Adding documentation on how to read change feed from the beginning
2 parents 898a914 + 1e10938 commit 443bc89

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

articles/cosmos-db/troubleshoot-changefeed-functions.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,15 @@ Additionally, the scenario can be validated, if you know how many Azure Function
8484

8585
One easy way to workaround this situation, is to apply a `LeaseCollectionPrefix/leaseCollectionPrefix` to your Function with a new/different value or, alternatively, test with a new leases container.
8686

87+
### Need to restart and re-process all the items in my container from the beginning
88+
To re-process all the items in a container from the beginning:
89+
1. Stop your Azure function if it is currently running.
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.
92+
1. Restart the Azure function. It will now read and process all changes from the beginning.
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.
95+
8796
### Binding can only be done with IReadOnlyList\<Document> or JArray
8897

8998
This error happens if your Azure Functions project (or any referenced project) contains a manual NuGet reference to the Azure Cosmos DB SDK with a different version than the one provided by the [Azure Functions Cosmos DB Extension](./troubleshoot-changefeed-functions.md#dependencies).

0 commit comments

Comments
 (0)