Microsoft Azure Stack is an extension of Azure—bringing the agility and innovation of cloud computing to your on-premises environment and enabling the only hybrid cloud that allows you to build and deploy hybrid applications anywhere. We bring together the best of the edge and cloud to deliver Azure services anywhere in your environment.

Sample: copy data from Azure Blob Storage to Azure SQL Database

In this tutorial, you create a Data Factory pipeline that copies data from Azure Blob Storage to Azure SQL Database. The configuration pattern in this tutorial applies to copying from a file-based data store to a relational data store.

You perform the following steps in this tutorial:

Create a data factory.

Create Azure Storage and Azure SQL Database linked services.

Create Azure BLob and Azure SQL Database datasets.

Create a pipeline contains a Copy activity.

Start a pipeline run.

Monitor the pipeline and activity runs.

Prerequisites

Azure subscription. If you don't have a subscription, you can create a free trial account.

Azure Storage account. You use the blob storage as source data store. If you don't have an Azure storage account, see the Create a storage account article for steps to create one.

Azure SQL Database. You use the database as sink data store. If you don't have an Azure SQL Database, see the Create an Azure SQL database article for steps to create one.

Create an application in Azure Active Directory following this instruction. Make note of the following values that you use in later steps: application ID, authentication key, and tenant ID. Assign application to "Contributor" role by following instructions in the same article.

Create blob and SQL table

Now, prepare your Azure Blob and Azure SQL Database for the tutorial by performing the following steps:

Create source blob

Launch Notepad. Copy the following text and save it as inputEmp.txt file on your disk.

John|Doe
Jane|Doe

Use tools such as Azure Storage Explorer to create the adfv2tutorial container, and to upload the inputEmp.txt file to the container.

Create sink SQL table

Use the following SQL script to create the dbo.emp table in your Azure SQL Database.

Allow Azure services to access SQL server. Ensure that Allow access to Azure services setting is turned ON for your Azure SQL server so that the Data Factory service can write data to your Azure SQL server. To verify and turn on this setting, do the following steps:

Click More services hub on the left and click SQL servers.

Select your server, and click Firewall under SETTINGS.

In the Firewall settings page, click ON for Allow access to Azure services.

Build and run the sample

Click Tools -> NuGet Package Manager -> Package Manager Console.

In the Package Manager Console, run the following commands to install packages: