CosmosDB Change Feed is not capturing all changes

222 Views Asked by At

I currently have a program that a user enters yes or no for certain questions and for each yes the user has to upload a file. If any of the data changes the users are to go back and update the fields, along with the files corresponding with the questions. All the data is being held in a Cosmo DB, and every week an email is sent out of what fields have been changed, along with if the file has been changed. My issue is the CosmosDB Change Feed is not capturing if just the file has been changed. If a yes or no field is changed it will come back in the email, but if it was just the file it won’t. If someone changes to a yes and uploads a file, it will show the status change to a yes and file.

I have tried adding another field, File Date Uploaded, so the audit could compare more data instead of just a couple letters change in the file name, but it did not change anything. Is there something I can do on the audit end for it to pick up my file changes without changing the status from no/yes? Why would it not be picking this up since I can clearly see the change in my Cosmo DB

1

There are 1 best solutions below

2
Thiago Custodio On

Pick the following document as an example:

{
   "active": "yes",
   "fileName": "text.docx"
}

if you change the values from "yes" to "no", or "text.docx" to "test.docx", those changes will be captured and available in your Azure CosmosDB Changefeed. However, if you're looking for the changes in the document itself, that's not something ChangeFeed will know, as the content of the document in not being stored into CosmosDB.

If you are using Blob Storage in an Azure Storage Account, you can use Event Grid, which will capture changes on blobs and let you consume such events using Azure Functions or Logic Apps for example.