how to get a last modified timestamp when copying file from SFTP to ADLSGEN2

Naga Nekkanti 20 Reputation points
2023-05-24T18:21:30.4033333+00:00

Hi team,

I am looking to get a last modified date for my source file when copying source file form SFTP to adlsgen2.

Instead of getting current timestamp in ADLS gen2 I need last modified timestamp.

Azure Data Lake Storage
Azure Data Lake Storage
An Azure service that provides an enterprise-wide hyper-scale repository for big data analytic workloads and is integrated with Azure Blob Storage.
1,505 questions
Azure Storage Accounts
Azure Storage Accounts
Globally unique resources that provide access to data management services and serve as the parent namespace for the services.
3,276 questions
Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
11,006 questions
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,039 questions
{count} votes

Accepted answer
  1. Sedat SALMAN 14,140 Reputation points MVP
    2023-05-25T06:01:21.3033333+00:00

    There isn't a built-in way to preserve the "last modified" timestamp when copying files from SFTP to Azure Data Lake Storage Gen2 (ADLS Gen2) with Azure Data Factory

    As a workaround

    When you are copying the file from SFTP, you can also retrieve the last modified timestamp and store it in the metadata of the blob in ADLS Gen2. This method requires using an additional service like Azure Functions or Logic Apps to retrieve the last modified date from the SFTP source and set it as metadata on the blob in ADLS Gen2.

    or

    If you are using Azure Databricks, you could potentially write a script that copies the file and retrieves the last modified date from the SFTP source, then stores that date in the metadata of the blob in ADLS Gen2.

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

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