Logic App - Sharepoint - Searching for files within sub-directories

Adam Peel 40 Reputation points
2025-02-18T16:02:59.3833333+00:00

Hi. I'm pretty inexperienced with logic apps and have been searching all over for help with this.

A colleague needs a directory and all sub-directories and files within to be copied from a sharepoint drive to ADLS2. I've tried looking into this but it looks like the only way in LA to do this is for files and not directories? Is this correct?

If you can only copy files to the data lake then can you loop through folders in logic apps to search for specific files (that ends in .xlsb in this case)? The directory is various sub-folders deep so looks like there would be alot of looping down.

I've been testing with the List Folder activity to return details of folders/files within a specified directory but this needs to go further down before looking for files containing .xlsb.

Any help with either situation I've asked about would be much appreciated, or if either are possible with other tools?

Thanks

Azure Logic Apps
Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
3,357 questions
SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
11,232 questions
0 comments No comments
{count} votes

Accepted answer
  1. Khadeer Ali 3,510 Reputation points Microsoft Vendor
    2025-02-19T13:54:28.5866667+00:00

    @Adam Peel ,

    Thanks for reaching out. Yes, your understanding is correct. Azure Logic Apps does not natively support copying entire directories from SharePoint to ADLS2. Instead, you can use a recursive approach to loop through folders and copy files individually. Here's a more detailed breakdown of the steps you could try:

    1. Trigger: Use a Recurrence trigger or an HTTP trigger to start the workflow.
    2. Get Folder Contents: Use the "List Folder" action in SharePoint to retrieve files and subfolders from the specified directory.
    3. Loop through Items:
      • If the item is a file and ends with .xlsb, use the "Get File Content" (SharePoint) action and upload it to ADLS2 using "Create Blob."
      • If the item is a folder, recursively call the same logic to process its contents.

    For large and complex data movements, Azure Data Factory (ADF) is indeed a better choice. ADF supports:

    • Copy Data Activity with the SharePoint connector for efficient file transfer.
    • A recursive pipeline to traverse and copy files from deeply nested folder structures.Yes, your understanding is correct.

    Hope this helps. Do let us know if you have any further queries.


    If this answers your query, do click Accept Answer and Yes for "Was this answer helpful." And if you have any further questions, let us know.


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.