Azure Audit is not capturing all changes

Owen Ganzer 0 Reputation points

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 feidls, 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 Azure audit 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 wont. 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 that did not work. Is there something I can do on the audit end in order 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

Azure Cosmos DB
Azure Cosmos DB
An Azure NoSQL database service for app development.
1,272 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Vahid Ghafarpour 8,610 Reputation points

    To address your specific requirement of capturing changes to the files uploaded without changing the status field (yes/no), you may need to implement custom logic in your application to track and record those changes explicitly. Here's a suggested approach by ChatGPT:

    When a user uploads a file, in addition to updating the corresponding document field, create a separate record in a separate collection or a separate document within Cosmos DB. This record should capture the information about the file upload, such as the file name, file upload date, and the corresponding document or resource it belongs to.

    Modify your application logic to compare the previous and current versions of the file to determine if there have been any changes. You can compare attributes such as the file name, file size, or even generate a hash of the file content to identify changes. If changes are detected, update a flag or timestamp in the corresponding document indicating that the file has been modified.

    Configure your application to send an email notification based on the changes detected. This email can include information about both field changes and file changes, based on the flags or timestamps recorded in the documents.

    0 comments No comments