Forum Discussion
Getting modification time in copy activity
Hello everyone!
We are ingesting data from an Azure storage account. The pipeline has a copy activity to the OneLake/Files storage and a small notebook to translate the data into OneLake/Tables.
The notebook does some logging, which serves us well, but we can't recognise when the data in Azure is stale.
The idea would be to somehow get the modification time of each file on the source. Is there any way to do that?
Best Regards,
Jörg
8 Replies
- frithjof_vCommunity Champion
Is it possible to use the Get Metadata activity?
- JoergNeulistRegular Visitor
I never considered this! It's a good pointer - but what next? I can't put the metadata into a variable in the notebook ("Error: Unable to convert metadata to string.")
I see that Set Variable would accept arrays, but how do I get that from inside the Notebook?
- frithjof_vCommunity Champion
You can pass variables from the pipeline into the Notebook:
https://learn.microsoft.com/en-us/fabric/data-factory/notebook-activity#notebook-settings
How do you do the copy, btw? Are you using a loop to run through the files in the Azure Storage and copy every one of them?
If so, you could perhaps use the outputs from the Get Metadata activity to select which files to copy before copying them with the Copy Activity?
EDIT: If you need to convert between array and string, or other manipulations, you could have a look and see if some functions can work for you:
https://learn.microsoft.com/en-us/fabric/data-factory/expression-language#functions
E.g.
- join
- split
- array
- string
and Activities
https://learn.microsoft.com/en-us/fabric/data-factory/activity-overview#control-flow-activities,
e.g.
- Filter