Azure Data Factory

Updated at:

Configure Azure Data Factory (ADF) as a data source for the scanner by creating a service principal and granting it access to your Data Factory resources.

Service account authorization

  1. Create a service principal and obtain authentication credentials

  • In the Azure portal, search for and select App registrations. If an application is not registered, click New registration to create one.

  • Click the application that you just created. On the Overview page, record the following:

    • Application (client) ID, which corresponds to client-id

    • Directory (tenant) ID, which corresponds to tenant-id

  • On the Overview page, select Certificates & secrets. In the Client secrets section, click New client secret to generate a client secret. Immediately copy its value to use as the client-secret-value. You cannot view the plaintext value again after you leave this page.

image.png

  1. Grant the service principal read permission on Data Factory

  • Open the target Data Factory resource. In the left navigation pane, select Access control (IAM). On the Role assignments tab, click Add role assignment. Assign the Data Factory Contributor role or a custom read-only role to the Service Principal for the app registration that you created.

image.png

Data source management

Option

Description

--tenant-id

Tenant ID. Required.

--client-id

Client ID. Required.

--client-secret-value

Client secret. Required.

--subscription-id

Azure subscription ID. Required.

--resource-group-name

Resource group name. Required.

--azure-cloud

Azure cloud type. Default: AZURE_CHINA_CLOUD.

--is-use-proxy

Whether to use a proxy. Valid values: `true` and `false`.

--proxy-host

Proxy host. Required if you use a proxy.

--proxy-port

Proxy port. Required if you use a proxy.

Configuration steps

  1. Follow Step 1 in Service account authorization to record the client-id, tenant-id, and client-secret-value.

  2. In the left navigation pane of the Data Factory resource, select Overview and record the following:

    • Resource group, which corresponds to resource-group-name

    • Subscription ID, which corresponds to subscription-id

image

lhm datasource set adf -n adf1 \
    --tenant-id xxx \
    --client-id xxx \
    --client-secret-value $ADF_SECRET \
    --subscription-id xxx \
    --resource-group-name rg-xxx