Ready to get started?

Learn more about the CData FireDAC Components for Azure Data Lake Storage or download a free trial:

Download Now

Build a Simple VCL Application for Azure Data Lake Storage Data

How to build a simple VCL Application to view Azure Data Lake Storage data in RAD Studio using the CData FireDAC Components for Azure Data Lake Storage.

Embarcadero RAD Studio provides a development environment for Delphi and C++Builder applications. With the CData FireDAC Components for Azure Data Lake Storage, you gain access to live Azure Data Lake Storage data within RAD Studio, abstracting the data into tables, views, and stored procedures that can be used to retrieve Azure Data Lake Storage data. This article will walk through connecting to Azure Data Lake Storage and creating a simple VCL application with the Form Designer.

Creating a VCL Application for Azure Data Lake Storage Data

The following instructions show how to use the Form Designer to create a simple VCL Forms application that shows the basic FireDAC objects needed to connect to Azure Data Lake Storage from any application.

The following example populates a TDBGrid control.

  1. Create a new VCL Forms Application.
  2. Drop a TFDPhysADLSDriverLink and TFDConnection object onto the form.
  3. Double-click the TFDConnection object. The FireDAC Connection Editor is displayed. Select "CData.ADLS" in the DriverId menu and configure the connection properties.

    Authenticating to a Gen 1 DataLakeStore Account

    Gen 1 uses OAuth 2.0 in Azure AD for authentication.

    For this, an Active Directory web application is required. You can create one as follows:

    1. Sign in to your Azure Account through the .
    2. Select "Azure Active Directory".
    3. Select "App registrations".
    4. Select "New application registration".
    5. Provide a name and URL for the application. Select Web app for the type of application you want to create.
    6. Select "Required permissions" and change the required permissions for this app. At a minimum, "Azure Data Lake" and "Windows Azure Service Management API" are required.
    7. Select "Key" and generate a new key. Add a description, a duration, and take note of the generated key. You won't be able to see it again.

    To authenticate against a Gen 1 DataLakeStore account, the following properties are required:

    • Schema: Set this to ADLSGen1.
    • Account: Set this to the name of the account.
    • OAuthClientId: Set this to the application Id of the app you created.
    • OAuthClientSecret: Set this to the key generated for the app you created.
    • TenantId: Set this to the tenant Id. See the property for more information on how to acquire this.
    • Directory: Set this to the path which will be used to store the replicated file. If not specified, the root directory will be used.

    Authenticating to a Gen 2 DataLakeStore Account

    To authenticate against a Gen 2 DataLakeStore account, the following properties are required:

    • Schema: Set this to ADLSGen2.
    • Account: Set this to the name of the account.
    • FileSystem: Set this to the file system which will be used for this account.
    • AccessKey: Set this to the access key which will be used to authenticate the calls to the API. See the property for more information on how to acquire this.
    • Directory: Set this to the path which will be used to store the replicated file. If not specified, the root directory will be used.

  4. Drop a TFDQuery object onto the form and set the properties below:

    • Connection - Set this property to the TFDConnection object, if this object is not already specified.
    • SQL - Click the button in the SQL property and enter a query.
    • Active - Set this property to true.
  5. Drop a TDataSource object onto the form and set the following property:

    • DataSet - In the menu for this property, select the name of the TFDQuery object.
  6. Drop a TDBGrid control onto the form and set the following property:

    • DataSource - Select the name of the TDataSource.
  7. Drop a TFDGUIxWaitCursor onto the form. This is required to avoid a run-time error.

You now have an executable application that displays the results of the SQL Query set in the TFDQuery object.