Extract File Metadata from Multiple Directories into Azure SQL Table

Need help to fetch metadata from a folder in ADF and store file names along with last modification dates into an Azure SQL table. Revised code sample below:

CREATE PROC usp_UpdateFileInfo (
    @FileName NVARCHAR(100),
    @ModifiedOn DATETIME
)
AS
BEGIN
    UPDATE dbo.FileLogs
    SET ModifiedOn = @ModifiedOn
    WHERE FileName = @FileName;
END;

hey, i also ran into sync issues while pullin metadata, and wonder if addin a slight delay might help. has anyone tried adjusting the trigger period to get more consistent modified dates? any sugestions would be awesome!

In my experience, combining a MERGE operation with your stored procedure can optimize the process by handling both updates and inserts in one go. This approach reduces the complexity in your ADF pipeline since you can call a single procedure rather than separating insert and update logic. I also found that thorough error handling, including retries for transient issues, significantly improves stability. Building the process in a modular way, where data extraction, merging, and logging are isolated, aids in troubleshooting and scaling as file volumes increase.

The approach provided is valid for updating existing records in the database. However, integrating this into an ADF pipeline requires a few extra steps. In my experience, you’ll need to build a pipeline that first uses a Lookup activity to get file metadata from your storage account. Then incorporate a ForEach activity to iterate through the file list and call a Stored Procedure activity that executes your procedure. This pattern ensures that all file metadata, including new entries, can be updated in the Azure SQL table reliably. Ensure proper error handling in the pipeline for robust operation.

hey, have u thought of using a conditional check to insert new records if needed, rather than only updating existing ones? sometimes i also add a small azure function to handle new files, which saves headaches with tz settings and updates.