How to rename a file using ADF

Thulasi Arumugam 20 Reputation points
2023-02-17T22:26:25.4833333+00:00
I have a blob container with parent folder and multiple sub folders and each sub folder having files. I would like to get the file names only (and not subfolder name) and rename the files names using ADF.

Parent folder -> subfolder->multiple subfolder-> file1.pdf
                 subfolder->multiple subfolder->multiple files
                 subfolder->multiple subfolder->multiple files

                       
I just need to rename the pdf files like file1_paper.pdf.

Any suggestions would me much appreciated. Thanks!
Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
11,624 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Nandan Hegde 36,146 Reputation points MVP Volunteer Moderator
    2023-02-18T04:39:32.6133333+00:00

    Hey,

    Please follow the below blog:
    https://datasharkx.wordpress.com/2023/02/06/calculate-folder-size-of-an-azure-blob-storage-data-lake-storage-via-synapse-data-factory-pipeline/

    To recursively iterate over the path and rather than calculating the file size, you can use a copy activity to copy the file with a new name and then delete the old file if need be


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.