(+351) 21 24 10006  ·  info@bconcepts.pt
Carnaxide, Lisbon

How to Create a Copy Pipeline in Azure Data Factory

João Barros 05 de July de 2026 4 min read

Moving a CSV file into a database is one of the most common tasks in any data project, and a copy pipeline in Azure Data Factory handles it without writing integration code. Azure Data Factory is Microsoft's cloud data orchestration service, and its Copy data activity is the most direct way to move data between two places. You will build, step by step, a pipeline that reads a CSV from Azure Blob Storage and loads it into a table in Azure SQL Database.

Prerequisites

  • An active Azure subscription with an Azure Data Factory instance already created.
  • An Azure Blob Storage account with a container and a CSV file (for example, clientes.csv).
  • An Azure SQL Database where you have permission to create tables.
  • Access to Azure Data Factory Studio to create linked services, datasets, and pipelines.

Step 1: Prepare the source and the destination

Before touching Data Factory, make sure both sides are ready: the file at the source and the table at the destination. A simple example of clientes.csv in Blob Storage:

id,nome,cidade
1,Ana,Lisboa
2,Bruno,Porto
3,Carla,Braga

In Azure SQL Database, create the table that will receive the data. Notice that the column names match those in the CSV, which makes automatic mapping simpler:

CREATE TABLE dbo.Clientes (
    id INT,
    nome NVARCHAR(100),
    cidade NVARCHAR(100)
);

Step 2: Create the linked services

A linked service is the connection (address and credentials) to an external system. Open Data Factory Studio, go to the Manage tab and choose Linked services > New. Create two: one for Azure Blob Storage (the source) and one for Azure SQL Database (the destination). For each one, test the connection with Test connection before saving, so you catch credential errors right here.

Step 3: Create the datasets

A dataset describes the shape and location of the data inside a linked service. On the Author tab, choose Datasets > New dataset. Create a DelimitedText dataset pointing to clientes.csv (tick the option that treats the first row as the header) and an Azure SQL table dataset pointing to dbo.Clientes. These two datasets will be the source and the destination of the copy.

Step 4: Create the pipeline and add the Copy data activity

Still on the Author tab, choose Pipelines > New pipeline. Drag the Copy data activity onto the canvas. Now configure it:

  • On the Source tab, select the CSV dataset.
  • On the Sink tab, select the SQL table dataset.
  • On the Mapping tab, click Import schemas to link each CSV column to the matching table column.

Step 5: Run the pipeline with Debug

Click Debug to run the pipeline without publishing. Data Factory runs the copy and shows the progress on the Output tab. If you want to be able to re-run it without piling up duplicate rows, set a pre-copy script on the Sink that clears the table before loading:

TRUNCATE TABLE dbo.Clientes;

Verify the result

When Debug finishes, the Output tab should show the Succeeded status. Hover over the row to see the details: the number of rows read and written should equal the number in the CSV. To confirm at the destination, run a simple query on the database:

SELECT COUNT(*) AS total FROM dbo.Clientes;

If the total matches the number of rows in the file, the copy worked.

Conclusion

You now have a working copy pipeline moving data from Blob Storage into Azure SQL Database. The natural next step is to publish your changes and add a Schedule trigger so the pipeline runs on its own every morning, or to parameterize the file name so you can reuse the same pipeline with several CSV files. Which of your day-to-day data would be most useful if it reached the database automatically?