In modern data engineering, integrating and synchronizing data across cloud platforms is essential. Many organizations rely on Azure SQL Database and MySQL for different parts of their operations, making it crucial to Copy Data from Azure SQL to MySQL efficiently and with proper transformations. Azure Data Factory (ADF) provides a robust, low-code solution to meet this requirement.
In this guide, we’ll walk you through how to Copy Data from Azure SQL to MySQL with column-level transformations using ADF’s Copy Data activity—without needing complex Data Flows.
Step 1: Assessing Source and Target Tables
Before you build your pipeline, ensure your source and target tables exist and are structured appropriately.
Source Table (Azure SQL Database):
- Table: Employees
- Columns: EmployeeID, FullName, Department, Salary
Example Data:
EmployeeID | FullName | Department | Salary
-----------|-------------|------------|------
1 | John Smith | HR | 4000
2 | Sarah Lee | IT | 5000
Target Table (MySQL):
- Table: EmployeeData
- Columns: EmployeeID, Name, Dept, AnnualSalary
Transformation Requirements:
- Rename FullName to Name
- Rename Department to Dept
- Transform Salary into AnnualSalary by multiplying by 12
After transformation, the MySQL table should look like:
EmployeeID | Name | Dept | AnnualSalary
-----------|-------------|------|-------------
1 | John Smith | HR | 48000
2 | Sarah Lee | IT | 60000
Step 2: Creating Linked Services
Start by configuring Linked Services in ADF, which define connection information for your data sources.
- Go to Manage > Linked Services in ADF Studio.
- Click + New and choose Azure SQL Database as your source. Enter your server, database, and authentication details, and test the connection.
- Repeat the process for Azure MySQL Database, providing server, port (usually 3306), database, and credentials. Test and create the connection.
Step 3: Defining Datasets
Datasets in ADF represent the structure and location of your data.
- Go to Author > Datasets > + New Dataset.
- Select Azure SQL Database, link it to your SQL Linked Service, and point it to the Employees table. Name it, e.g., Employees_AzureSQL.
- Create a second dataset for Azure MySQL Database, link to your MySQL Linked Service, and select the EmployeeData table.
Step 4: Building the Copy Data Pipeline with Transformation to Copy Data from Azure SQL to MySQL
With Linked Services and datasets in place, create a pipeline to transfer and transform data.
- Go to Author > Pipelines > + New Pipeline in ADF Studio.
- Drag the Copy Data activity onto the canvas.
- Under the Source tab, select your Azure SQL dataset and enter a custom SQL query to perform the transformations:
SELECT
EmployeeID,
FullName AS Name,
Department AS Dept,
Salary * 12 AS AnnualSalary
FROM Employees;
- In the Sink tab, choose the MySQL dataset as your destination.
- On the Mapping tab, confirm that the transformed columns map correctly to the MySQL table fields.
Step 5: Running and Validating the Pipeline
After configuring your pipeline:
- Click Validate All to check for errors.
- Click Publish All to deploy.
- Trigger the pipeline manually or schedule it for automated runs.
When executed, ADF will copy your data from Azure SQL to MySQL, applying the SQL-based transformations on the fly. You can verify the results in MySQL Workbench by querying the EmployeeData table.
Step 6: Conclusion
With this approach, data integration between Azure SQL and MySQL becomes fast, cost-effective, and highly maintainable. By leveraging Azure Data Factory’s Copy Data activity along with in-source SQL queries, you can perform essential column transformations directly within the pipeline — eliminating the need for complex Data Flows or external ETL tools.
This method is ideal for straightforward transformations and regular synchronization tasks, especially when you want to move data efficiently between heterogeneous databases. It also ensures consistency across environments by centralizing transformation logic within ADF, making it easier to monitor, debug, and extend as your data ecosystem evolves.
As your business scales, you can enhance this setup by incorporating dynamic parameters for table names, schema mappings, and incremental loads — enabling reusable and automated pipelines across multiple datasets. Combined with ADF’s scheduling, monitoring, and alerting capabilities, this solution offers a reliable and production-ready approach to cross-database data movement in the Azure ecosystem.
In short, ADF empowers data engineers to build reliable, scalable, and transformation-ready pipelines—ensuring smooth automated workflows when you copy data from Azure SQL to MySQL.
Watch the full video here: