Share via

CosmosDB Change Feed, move on in the feed without code changes

Johnston, Anthony 5 Reputation points
2025-08-26T10:35:25.2+00:00

I have been asked to find a strategy for moving on to the next record in a change feed, manually, not in the code.

I have looked at the documentation on change feed processors and the leases they create to bookmark their current location in the feed.

Changing the lease manually makes me nervous as it is an internal structure and I don't know what will happen if I do and it breaks.

Please can I have some guidance on this approach or any other you can suggest

Thank you

Azure Cosmos DB
Azure Cosmos DB

An Azure NoSQL database service for app development.


1 answer

Sort by: Most helpful
  1. Anonymous
    2025-08-27T13:16:46.34+00:00

    Hi @Johnston, Anthony,

    It appears you're aiming to explore the Cosmos DB change feed manually, without introducing any modifications to the existing codebase.

    1. While the Azure Portal does not offer a direct interface to manually navigate the change feed, you can inspect data changes and their associated timestamps by querying the container directly. This allows visibility into the latest updates without altering the change feed processor's lease state.
    2. Implement a Custom Tracking - Instead of modifying lease configurations, implement a custom field—such as a status attribute—within your documents to track processing state. This enables efficient filtering of unprocessed entries and facilitates controlled handling of change feed events without altering lease mechanics.
    3. Replica Approach - If direct lease manipulation is a concern, consider maintaining a separate Cosmos DB container or an alternative storage solution such as Azure Blob Storage to log change feed events or processing metadata. This approach allows independent management of processing state and avoids interference with the built-in lease coordination mechanism
    4. For a resilient and scalable solution, leveraging Azure Functions or a dedicated Change Feed Processor is recommended for handling change feed events. These services offer native support for lease management, ensuring fault tolerance and eliminating the need for manual intervention in lease state coordination.
    5. Refer document -
      https://learn.microsoft.com/en-us/azure/cosmos-db/nosql/change-feed-design-patterns?tabs=latest-version https://learn.microsoft.com/en-us/azure/cosmos-db/nosql/read-change-feed

    If you have more detailed information about what you're specifically trying to achieve or concerns regarding the change feed, feel free to share.

    Regards,
    Vrishabh

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.