Catapultaa
Catapultaa

Reputation: 170

How to rename a blob storage file from Azure Data Factory?

I have a Pipeline on Azure Data Factory that go through several folders from Blob Storage (with a ForEach Activities). Inside thoses folders, I need to rename a file (files have the same name on every folders) I don't want to use copy activities to rename the file and I failed using Azure Function Activities to do it. How Can I pass parameters from Azure Data Factory to Azure Function and what is the architecture of the Azure Function (or Logic Apps) to rename a blob file ?

Upvotes: 0

Views: 4541

Answers (1)

Maciek Sondej
Maciek Sondej

Reputation: 56

The easiest way seems to use Blob folder change(file upload) trigger which can be used on both AF and LA. When you get this trigger you have your file name(that you don't like) you just make a copy of this file(with desired name) to your desired folder and delete old file or move it to some archive folder. Both tasks can be achieved using AF and LA however I would suggest using AF as it is easier and more robust than AF.. and much much cheaper.

ps. You can't rename files that are in Blob.. the only way is to copy content of source blob to target blob with different name. Blob name in the folder is like "index".

Upvotes: 1

Related Questions