使用 Azure 数据工厂从 Google AdWords 复制数据Copy data from Google AdWords using Azure Data Factory

适用于:是 Azure 数据工厂是 Azure Synapse Analytics(预览版)APPLIES TO: yesAzure Data Factory yesAzure Synapse Analytics (Preview)

本文概述了如何使用 Azure 数据工厂中的复制活动从 Google AdWords 复制数据。This article outlines how to use the Copy Activity in Azure Data Factory to copy data from Google AdWords. 它是基于概述复制活动总体的复制活动概述一文。It builds on the copy activity overview article that presents a general overview of copy activity.

支持的功能Supported capabilities

以下活动支持此 Google AdWords 连接器:This Google AdWords connector is supported for the following activities:

可以将数据从 Google AdWords 复制到任何支持的接收器数据存储。You can copy data from Google AdWords to any supported sink data store. 有关复制活动支持作为源/接收器的数据存储列表,请参阅支持的数据存储表。For a list of data stores that are supported as sources/sinks by the copy activity, see the Supported data stores table.

Azure 数据工厂提供内置的驱动程序用于启用连接,因此无需使用此连接器手动安装任何驱动程序。Azure Data Factory provides a built-in driver to enable connectivity, therefore you don't need to manually install any driver using this connector.

入门Getting started

若要使用管道执行复制活动,可以使用以下工具或 SDK 之一:To perform the Copy activity with a pipeline, you can use one of the following tools or SDKs:

对于特定于 Google AdWords 连接器的数据工厂实体,以下部分提供了有关用于定义这些实体的属性的详细信息。The following sections provide details about properties that are used to define Data Factory entities specific to Google AdWords connector.

链接服务属性Linked service properties

Google AdWords 链接服务支持以下属性:The following properties are supported for Google AdWords linked service:

属性Property 说明Description 必须Required
typetype type 属性必须设置为:GoogleAdWordsThe type property must be set to: GoogleAdWords Yes
clientCustomerIDclientCustomerID 需提取其报表数据的 AdWords 帐户的客户端客户 ID。The Client customer ID of the AdWords account that you want to fetch report data for. Yes
developerTokendeveloperToken 与管理员帐户相关联的开发人员令牌,该帐户用来授予对 AdWords API 的访问权限。The developer token associated with the manager account that you use to grant access to the AdWords API. 可选择将此字段标记为 SecureString,将其安全地存储在 ADF 中,或在 Azure Key Vault 中存储密码,并允许 ADF 复制活动在执行数据复制时从此处拉取(请参阅在 Key Vault 中存储凭据了解详细信息)。You can choose to mark this field as a SecureString to store it securely in ADF, or store password in Azure Key Vault and let ADF copy activity pull from there when performing data copy - learn more from Store credentials in Key Vault. Yes
authenticationTypeauthenticationType 用于身份验证的 OAuth 2.0 身份验证机制。The OAuth 2.0 authentication mechanism used for authentication. ServiceAuthentication 只能在自托管 IR 上使用。ServiceAuthentication can only be used on self-hosted IR.
允许值包括:ServiceAuthentication、UserAuthentication Allowed values are: ServiceAuthentication, UserAuthentication
Yes
refreshTokenrefreshToken 从 Google 获得的刷新令牌,用于授权访问 AdWords 以进行用户身份验证。The refresh token obtained from Google for authorizing access to AdWords for UserAuthentication. 可选择将此字段标记为 SecureString,将其安全地存储在 ADF 中,或在 Azure Key Vault 中存储密码,并允许 ADF 复制活动在执行数据复制时从此处拉取(请参阅在 Key Vault 中存储凭据了解详细信息)。You can choose to mark this field as a SecureString to store it securely in ADF, or store password in Azure Key Vault and let ADF copy activity pull from there when performing data copy - learn more from Store credentials in Key Vault. No
clientIdclientId Google 应用程序的客户端 ID,用于获取刷新令牌。The client ID of the Google application used to acquire the refresh token. 可选择将此字段标记为 SecureString,将其安全地存储在 ADF 中,或在 Azure Key Vault 中存储密码,并允许 ADF 复制活动在执行数据复制时从此处拉取(请参阅在 Key Vault 中存储凭据了解详细信息)。You can choose to mark this field as a SecureString to store it securely in ADF, or store password in Azure Key Vault and let ADF copy activity pull from there when performing data copy - learn more from Store credentials in Key Vault. No
clientSecretclientSecret Google 应用程序的客户端机密,用户获取刷新令牌。The client secret of the google application used to acquire the refresh token. 可选择将此字段标记为 SecureString,将其安全地存储在 ADF 中,或在 Azure Key Vault 中存储密码,并允许 ADF 复制活动在执行数据复制时从此处拉取(请参阅在 Key Vault 中存储凭据了解详细信息)。You can choose to mark this field as a SecureString to store it securely in ADF, or store password in Azure Key Vault and let ADF copy activity pull from there when performing data copy - learn more from Store credentials in Key Vault. No
电子邮件email 用于 ServiceAuthentication 的服务帐户电子邮件 ID,只能在自托管 IR 上使用。The service account email ID that is used for ServiceAuthentication and can only be used on self-hosted IR. No
keyFilePathkeyFilePath .p12 密钥文件的完整路径,该文件用于对服务帐户电子邮件地址进行身份验证,只能在自托管 IR 上使用。The full path to the .p12 key file that is used to authenticate the service account email address and can only be used on self-hosted IR. No
trustedCertPathtrustedCertPath 包含受信任 CA 证书(通过 TLS 进行连接时用来验证服务器)的 .pem 文件的完整路径。The full path of the .pem file containing trusted CA certificates for verifying the server when connecting over TLS. 只有在自承载 IR 上使用 TLS 时才能设置此属性。This property can only be set when using TLS on self-hosted IR. 默认值是随 IR 一起安装的 cacerts.pem 文件。The default value is the cacerts.pem file installed with the IR. No
useSystemTrustStoreuseSystemTrustStore 指定是使用系统信任存储中的 CA 证书还是使用指定 PEM 文件中的 CA 证书。Specifies whether to use a CA certificate from the system trust store or from a specified PEM file. 默认值为 false。The default value is false. No

示例:Example:

{
    "name": "GoogleAdWordsLinkedService",
    "properties": {
        "type": "GoogleAdWords",
        "typeProperties": {
            "clientCustomerID" : "<clientCustomerID>",
            "developerToken": {
                "type": "SecureString",
                "value": "<developerToken>"
            },
            "authenticationType" : "ServiceAuthentication",
            "refreshToken": {
                "type": "SecureString",
                "value": "<refreshToken>"
            },
            "clientId": {
                "type": "SecureString",
                "value": "<clientId>"
            },
            "clientSecret": {
                "type": "SecureString",
                "value": "<clientSecret>"
            },
            "email" : "<email>",
            "keyFilePath" : "<keyFilePath>",
            "trustedCertPath" : "<trustedCertPath>",
            "useSystemTrustStore" : true,
        }
    }
}

数据集属性Dataset properties

有关可用于定义数据集的各部分和属性的完整列表,请参阅数据集一文。For a full list of sections and properties available for defining datasets, see the datasets article. 本部分提供 Google AdWords 数据集支持的属性列表。This section provides a list of properties supported by Google AdWords dataset.

若要从 Google AdWords 复制数据,请将数据集的 type 属性设置为 GoogleAdWordsObjectTo copy data from Google AdWords, set the type property of the dataset to GoogleAdWordsObject. 支持以下属性:The following properties are supported:

属性Property 说明Description 必须Required
typetype 数据集的 type 属性必须设置为:GoogleAdWordsObjectThe type property of the dataset must be set to: GoogleAdWordsObject Yes
tableNametableName 表的名称。Name of the table. 否(如果指定了活动源中的“query”)No (if "query" in activity source is specified)

示例Example

{
    "name": "GoogleAdWordsDataset",
    "properties": {
        "type": "GoogleAdWordsObject",
        "typeProperties": {},
        "schema": [],
        "linkedServiceName": {
            "referenceName": "<GoogleAdWords linked service name>",
            "type": "LinkedServiceReference"
        }
    }
}

复制活动属性Copy activity properties

有关可用于定义活动的各部分和属性的完整列表,请参阅管道一文。For a full list of sections and properties available for defining activities, see the Pipelines article. 本部分提供 Google AdWords 数据源支持的属性列表。This section provides a list of properties supported by Google AdWords source.

充当源的 Google AdWordsGoogle AdWords as source

若要从 Google AdWords 复制数据,请将复制活动中的源类型设置为“GoogleAdWordsSource” 。To copy data from Google AdWords, set the source type in the copy activity to GoogleAdWordsSource. 复制活动source部分支持以下属性:The following properties are supported in the copy activity source section:

属性Property 说明Description 必须Required
typetype 复制活动 source 的 type 属性必须设置为:GoogleAdWordsSourceThe type property of the copy activity source must be set to: GoogleAdWordsSource Yes
查询query 使用自定义 SQL 查询读取数据。Use the custom SQL query to read data. 例如:"SELECT * FROM MyTable"For example: "SELECT * FROM MyTable". 否(如果指定了数据集中的“tableName”)No (if "tableName" in dataset is specified)

示例:Example:

"activities":[
    {
        "name": "CopyFromGoogleAdWords",
        "type": "Copy",
        "inputs": [
            {
                "referenceName": "<GoogleAdWords input dataset name>",
                "type": "DatasetReference"
            }
        ],
        "outputs": [
            {
                "referenceName": "<output dataset name>",
                "type": "DatasetReference"
            }
        ],
        "typeProperties": {
            "source": {
                "type": "GoogleAdWordsSource",
                "query": "SELECT * FROM MyTable"
            },
            "sink": {
                "type": "<sink type>"
            }
        }
    }
]

Lookup 活动属性Lookup activity properties

若要了解有关属性的详细信息,请查看 Lookup 活动To learn details about the properties, check Lookup activity.

后续步骤Next steps

有关 Azure 数据工厂中复制活动支持作为源和接收器的数据存储的列表,请参阅支持的数据存储For a list of data stores supported as sources and sinks by the copy activity in Azure Data Factory, see supported data stores.