How to copy multiple unknown number of excel worksheets in azure data factory

Amrinder singh 1 Reputation point
2021-08-27T03:28:43.907+00:00

We have schedule weekly excel files coming into blob storage.
We want to copy that excel into azure data base using azure data factory.
Excel file sometimes contains 5 worksheets and sometime 6 or 7. Is there any way adf copies worksheets dynamically.

Azure SQL Database
Azure Logic Apps
Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
3,250 questions
Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
11,002 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Nandan Hegde 32,911 Reputation points MVP
    2021-08-27T04:27:14.167+00:00

    Hey,
    Based on my understanding ADF doesnt have in built functionality to provide the sheet names.

    So you would have to create a custom logic via Python/Powershell leveraging Azure function/ Batch to get the sheet names :

    https://stackoverflow.com/questions/12250024/how-to-obtain-sheet-names-from-xls-files-without-loading-the-whole-file

    And then leverage For loop iteration to copy those sheets .

    0 comments No comments

  2. HimanshuSinha-msft 19,476 Reputation points Microsoft Employee
    2021-08-27T19:37:10.87+00:00

    Thanks @Nandan Hegde ,

    Hello @Amrinder singh ,

    Thanks for the ask and using the Microsoft Q&A platform .

    May be simpler solution ( i have not implemented this till now )
    At this time ADF assumes that we know what are the worksheets we have in the spreadsheet . In your case its not , but i suggest you create 3 WS in excel , in case when you have data in WS 1 only the data in other WS will be blank . It should work out .

    Please do let me know how it goes .
    Thanks
    Himanshu

    0 comments No comments

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.