Importing Data into Microsoft Azure Data Lake Store (Gen1 and Gen2) Using Sqoop

Microsoft Azure Data Lake Store (ADLS) is a cloud object store designed for use as a hyper-scale repository for big data analytic workloads. ADLS acts as a persistent storage layer for CDH clusters running on Azure.

There are two generations of ADLS, Gen1 and Gen2. You can use Apache Sqoop with both generations of ADLS to efficiently transfer bulk data between these file systems and structured datastores such as relational databases. For more information on ADLS Gen 1 and Gen 2, see:

You can use Sqoop to import data from any relational database that has a JDBC adaptor such as SQL Server, MySQL, and others, to the ADLS file system.

The major benefits of using Sqoop to move data are:
  • It leverages RDBMS metadata to get the column data types
  • It ensures fault-tolerant and type-safe data handling
  • It enables parallel and efficient data movement

Configuring Sqoop to Import Data into Microsoft Azure Data Lake Storage (ADLS)


The configuration procedure presumes that you have already set up an Azure account, and have configured an ADLS Gen1 store or ADLS Gen2 storage account and container. See the following resources for information:


To connect CDH to ADLS with OAuth, you must configure the Hadoop CredentialProvider or core-site.xml directly. Although configuring the core-site.xml is convenient, it is insecure, because the contents of core-site.xml configuration file are not encrypted. For this reason, Cloudera recommends using a credential provider. For more information, see Configuring OAuth in CDH.

You can also pass the credentials by providing them on the Sqoop command line as part of the import command.

sqoop import

For example:

sqoop import$TENANT_ID/oauth2/token$CLIENT_ID$CLIENT_SECRET

Sqoop Import into ADLS

To import data into ADLS from diverse data sources, such as a relational database, enter the Sqoop import command on the command line of your cluster. Make sure that you specify the Sqoop connection to the data source you want to import.

If you want to enter a password for the data source, use the -P option in the connection string. If you want to specify a file where the password is stored, use the --password-file option.

sqoop import
--connect... --username... --password... --table... --target-dir... --split-by...

ABFS example:

sqoop import$TENANT_ID/oauth2/token$CLIENT_ID$CLIENT_SECRET
--connect $CONN --username $USER --password $PWD --table $TABLENAME --target-dir abfs://$CONTAINER$$TARGET-DIRECTORY --split-by $COLUMN_NAME

ADLS example:

sqoop import
--connect $CONN --username $USER --password $PWD --table $TABLENAME --target-dir adl://$TARGET-ADDRESS/$TARGET-DIRECTORY --split-by $COLUMN_NAME