– To auto create a table based on source Blob file ( it’s default file columns) using ADF’s pipeline.

You should follow the below architecture to achieve:

Explanation :

1. GetMetadata Activity:

Inside Getmetadata activity select your blob dataset and Field List as “childItem”

2. Connect this getmetadata activity to set variable. And set the following property:

Pass the following expression in Value: @array(activity(‘Get Metadata1’).output.childItems)

Also make sure that you have created a variable in pipeline before setting up set variable activity:

3. Third activity is foreach activity and give the items as @variables(‘test’)

Add a copy activity in the “Activities” tab of Foreach :

4. Copy activity:
Provide the following setting in the source of Copy activity :

Select the blob storage dataset and provide the following settings:

In above screenshot, I had created a folder named Srini in my blob location under which I have 3 csv files.

In the sink side of copy activity:
1.Opne the SQL dataset and create the parameter inside that.
After creating parameter, now pass the table name with dynamic expression inside SQL dataset:

Lets get back to Copy activity again and pass the following setting:

Tablename will appear on your copy activity sink option if you will create it under the dataset as I mentioed above. Inside tablename pass this dynamic expression : @split(string(item().name),’.’)[0]

Here are the files available in the blob storage:

Here are the auto created tables:

  • Ask Question