你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
适用于:
Azure 数据工厂
Azure Synapse Analytics
Tip
Microsoft Fabric 中的 Data Factory 是下一代 Azure 数据工厂,具有更加简化的架构、内置人工智能和新功能。 如果不熟悉数据集成,请从Fabric数据工厂开始。 现有 ADF 工作负载可以升级到 Fabric,以跨数据科学、实时分析和报告访问新功能。
Important
对 Azure 机器学习工作室(经典版)的支持将于 2024 年 8 月 31 日结束。 建议按该日期转换到 Azure 机器学习。
自 2021 年 12 月 1 日起,无法创建新的机器学习工作室(经典)资源(工作区和 Web 服务计划)。 到 2024 年 8 月 31 日,可以继续使用现有的机器学习工作室(经典)试验和 Web 服务。 有关详细信息,请参阅:
机器学习工作室(经典)文档即将停用,将来可能不会更新。
本文介绍可用于处理或转换数据的不同计算环境。 同时还详细介绍了在配置用于链接这些计算环境的链接服务时支持的不同配置(按需和自带)。
下表提供了支持的计算环境以及可以在其上运行的活动的列表。
HDInsight 计算环境
有关在按需和自带计算(BYOC)环境中配置支持的存储链接服务类型的详细信息,请参阅下表。
| 计算链接服务中 | 属性名称 | Description | Blob | ADLS Gen2 | Azure SQL DB | ADLS Gen 1 |
|---|---|---|---|---|---|---|
| On-demand | linkedServiceName | 将由按需群集用于存储和处理数据的 Azure 存储链接服务。 | Yes | Yes | No | No |
| additionalLinkedServiceNames | 指定用于 HDInsight 链接服务的附加存储帐户,以便该服务可以代表你注册这些帐户。 | Yes | No | No | No | |
| hcatalogLinkedServiceName | 指向 HCatalog 数据库的Azure SQL链接服务的名称。 按需 HDInsight 群集是使用 Azure SQL 数据库作为元存储创建的。 | No | No | Yes | No | |
| BYOC | linkedServiceName | Azure 存储链接服务引用。 | Yes | Yes | No | No |
| additionalLinkedServiceNames | 指定用于 HDInsight 链接服务的附加存储帐户,以便该服务可以代表你注册这些帐户。 | No | No | No | No | |
| hcatalogLinkedServiceName | 指向 HCatalog 数据库的 Azure SQL 链接服务引用。 | No | No | No | No |
Azure HDInsight按需链接服务
在这种类型的配置中,计算环境完全由服务管理。 作业提交到进程数据前,该服务会自动创建计算环境,作业完成后则自动将其删除。 可以为按需计算环境创建并配置链接服务,以及控制作业执行、群集管理和引导操作的粒度设置。
Note
目前仅Azure HDInsight群集支持按需配置。 Azure Databricks还支持使用作业群集的按需作业。 有关详细信息,请参阅 Azure databricks 链接服务。
服务可自动创建按需 HDInsight 群集,以处理数据。 群集在与与群集关联的 storage 帐户(JSON 中的 linkedServiceName 属性)所在的同一区域中创建。 存储帐户must是常规用途标准Azure 存储帐户。
请注意有关按需 HDInsight 链接服务的以下 重要点:
- 按需 HDInsight 群集是在Azure订阅下创建的。 群集启动并运行后,可以在 Azure 门户中看到群集。
- 在按需启动的 HDInsight 群集上运行的作业的日志将被复制到与 HDInsight 群集关联的存储帐户中。 在链接的服务定义中定义的 clusterUserName、clusterPassword、clusterSshUserName、clusterSshPassword 用于登录到群集,以便在群集的生命周期内进行深入故障排除。
- 仅对 HDInsight 群集启动并运行作业的时间进行收费。
- 可以将 脚本操作 与 Azure HDInsight 按需联机服务配合使用。
Important
通常需要20分钟或更多时间按需预配Azure HDInsight群集。
使用服务主体密钥的示例
以下 JSON 定义基于 Linux 的按需 HDInsight 链接服务。 该服务会自动创建 基于 Linux 的 HDInsight 群集来处理所需的活动。
{
"name": "HDInsightOnDemandLinkedService",
"properties": {
"type": "HDInsightOnDemand",
"typeProperties": {
"clusterType": "hadoop",
"clusterSize": 1,
"timeToLive": "00:15:00",
"hostSubscriptionId": "<subscription ID>",
"servicePrincipalId": "<service principal ID>",
"servicePrincipalKey": {
"value": "<service principal key>",
"type": "SecureString"
},
"tenant": "<tenant id>",
"clusterResourceGroup": "<resource group name>",
"clusterResourceGroupAuthType": "ServicePrincipalKey",
"version": "3.6",
"osType": "Linux",
"linkedServiceName": {
"referenceName": "AzureStorageLinkedService",
"type": "LinkedServiceReference"
}
},
"connectVia": {
"referenceName": "<name of Integration Runtime>",
"type": "IntegrationRuntimeReference"
}
}
}
使用系统分配的托管标识的示例
以下 JSON 定义基于 Linux 的按需 HDInsight 链接服务。 该服务会自动创建 基于 Linux 的 HDInsight 群集来处理所需的活动。
{
"name": "HDInsightOnDemandLinkedService",
"properties": {
"type": "HDInsightOnDemand",
"typeProperties": {
"clusterType": "hadoop",
"clusterSize": 1,
"timeToLive": "00:15:00",
"hostSubscriptionId": "<subscription ID>",
"clusterResourceGroup": "<resource group name>",
"clusterResourceGroupAuthType": "SystemAssignedManagedIdentity",
"version": "3.6",
"osType": "Linux",
"linkedServiceName": {
"referenceName": "AzureStorageLinkedService",
"type": "LinkedServiceReference"
}
},
"connectVia": {
"referenceName": "<name of Integration Runtime>",
"type": "IntegrationRuntimeReference"
}
}
}
使用用户分配的托管标识的示例
以下 JSON 定义基于 Linux 的按需 HDInsight 链接服务。 该服务会自动创建 基于 Linux 的 HDInsight 群集来处理所需的活动。
{
"name": "HDInsightOnDemandLinkedService",
"properties": {
"type": "HDInsightOnDemand",
"typeProperties": {
"clusterType": "hadoop",
"clusterSize": 1,
"timeToLive": "00:15:00",
"hostSubscriptionId": "<subscription ID>",
"clusterResourceGroup": "<resource group name>",
"clusterResourceGroupAuthType": "UserAssignedManagedIdentity",
"credential": {
"referenceName": "CredentialName",
"type": "CredentialReference"
},
"version": "3.6",
"osType": "Linux",
"linkedServiceName": {
"referenceName": "AzureStorageLinkedService",
"type": "LinkedServiceReference"
}
},
"connectVia": {
"referenceName": "<name of Integration Runtime>",
"type": "IntegrationRuntimeReference"
}
}
}
Important
HDInsight 群集在您于 JSON 中指定的 Blob 存储(linkedServiceName)中创建一个 default 容器。 HDInsight 不会在删除群集时删除此容器。 这是设计的行为。 使用按需 HDInsight 链接服务时,每次需要处理切片时都会创建 HDInsight 群集,除非存在现有的实时群集(timeToLive),并在处理完成后删除。
随着更多活动的进行,您会在 Azure Blob 存储中看到许多容器。 如果不需要它们来排查作业问题,可以考虑删除它们以减少存储成本。 这些容器的名称遵循 adf**yourfactoryorworkspacename**-**linkedservicename**-datetimestamp 模式。 使用 Microsoft Azure 存储资源管理器 等工具删除Azure blob 存储中的容器。
属性
| Property | Description | Required |
|---|---|---|
| 类型 | type 属性应设置为 HDInsightOnDemand。 | Yes |
| clusterSize | 群集中辅助进程/数据节点的数量。 HDInsight 群集创建时具有 2 个头节点以及一定数量的辅助进程节点(此节点的数量是为此属性所指定的数量)。 这些节点的大小为拥有 4 个核心的 Standard_D3,因此一个具有 4 个工作器节点的群集拥有 24 个核心(工作器节点有 4*4 = 16 个核心,头节点有 2*4 = 8 个核心)。 请参阅使用 Hadoop、Spark、Kafka 等在 HDInsight 中设置群集,了解详细信息。 | Yes |
| linkedServiceName | 按需群集使用的Azure 存储链接服务,用于存储和处理数据。 HDInsight 群集是在与此Azure 存储帐户相同的区域中创建的。 Azure HDInsight对可在它支持的每个Azure区域中使用的核心总数有限制。 请确保在该Azure区域中有足够的核心配额来满足所需的群集大小。 有关详细信息,请参阅使用 Hadoop、Spark、Kafka 等在 HDInsight 中设置群集 目前,无法创建使用 Azure Data Lake Storage (Gen 2) 作为存储的按需 HDInsight 群集。 如果要将 HDInsight 处理的结果数据存储在Azure Data Lake Storage(第 2 代)中,请使用复制活动将数据从Azure Blob 存储复制到Azure Data Lake Storage(第 2 代)。 |
Yes |
| clusterResourceGroup | 在此资源组中创建 HDInsight 群集。 | Yes |
| clusterResourceGroupAuthType | 指定 HDInsight 按需群集资源组身份验证类型。 支持的身份验证类型为“ServicePrincipalKey”、“SystemAssignedManagedIdentity”、“UserAssignedManagedIdentity”。 | 使用托管标识身份验证时需要此项。 如果字段不存在,则默认为 ServicePrincipalKey |
| 凭据 | 指定包含对资源组具有访问权限的托管标识对象的凭据引用。 | 仅在进行“UserAssignedManagedIdentity”身份验证时必需。 |
| timetolive | 按需 HDInsight 群集允许的空闲时间。 指定当活动运行完成后,如果群集中没有其他的活动作业,按需 HDInsight 群集保持活动状态的时间。 允许的最小值为 5 分钟 (00: 05:00)。 例如,如果一个活动运行需要 6 分钟,而 timetolive 的设置是 5 分钟,则当 6 分钟的活动运行处理结束后,群集将保持 5 分钟的活动状态。 如果在这 6 分钟的时间内执行其他的活动运行,则由同一群集进行处理。 创建按需 HDInsight 群集是一项开销非常大的操作(可能会花费一定的时间),因此请根据需要使用此设置,以通过重复使用一个按需 HDInsight 群集来提高服务的性能。 如果将 timetolive 值设置为 0,则将会在活动运行处理完后立即删除群集。 然而,如果设置了较高的值,则群集可以保持空闲状态,以方便你登录进行某些故障排除工作,但这可能会导致成本高昂。 因此,根据具体需要设置适当的值非常重要。 如果 timetolive 属性值设置适当,多个管道则可共享按需 HDInsight 群集实例。 |
Yes |
| clusterType | 要创建的 HDInsight 群集的类型。 允许的值是“hadoop”和“spark”。 如果未指定,默认值为 hadoop。 无法按需创建已启用企业安全套件的群集,应使用现有群集/自带计算资源。 | No |
| 版本 | HDInsight 群集的版本。 如果未指定较高的值,则使用当前 HDInsight 定义的默认版本。 | No |
| hostSubscriptionId | 用于创建 HDInsight 群集的Azure订阅 ID。 如果未指定,则使用Azure登录上下文的订阅 ID。 | No |
| clusterNamePrefix | HDI 群集名称的前缀,会自动在群集名称末尾追加时间戳 | No |
| sparkVersion | 群集类型为“Spark”时的 spark 版本 | No |
| additionalLinkedServiceNames | 指定用于 HDInsight 链接服务的附加存储帐户,以便该服务可以代表你注册这些帐户。 这些storage帐户必须与 HDInsight 群集位于同一区域中,该群集是在与 linkedServiceName 指定的storage帐户相同的区域中创建的。 | No |
| osType | 操作系统的类型。 允许的值为:Linux 和Windows(仅适用于 HDInsight 3.3)。 默认值为 Linux。 | No |
| hcatalogLinkedServiceName | 指向 HCatalog 数据库的Azure SQL链接服务的名称。 按需 HDInsight 群集是使用 Azure SQL 数据库 作为元存储创建的。 | No |
| connectVia | 用于将活动调度到此 HDInsight 链接服务的 Integration Runtime。 对于按需的 HDInsight 关联服务,它仅支持 Azure Integration Runtime。 如果未指定,则使用默认Azure Integration Runtime。 | No |
| clusterUserName | 用于访问群集的用户名。 | No |
| clusterPassword | 用于访问群集的安全字符串类型的密码。 | No |
| clusterSshUserName | 用于通过 SSH 远程连接到群集节点的用户名(适用于 Linux)。 | No |
| clusterSshPassword | 用于通过 SSH 远程连接到群集节点的安全字符串类型密码(适用于 Linux)。 | No |
| scriptActions | 在按需创建群集期间指定 HDInsight 群集自定义的脚本。 目前,UI 创作工具仅支持指定 1 个脚本操作,但你可以通过 JSON 解决此限制(在 JSON 中指定多个脚本操作)。 |
No |
Important
HDInsight 支持多个可部署的 Hadoop 群集版本。 每个版本选项创建 Hortonworks 数据平台 (HDP) 分发的特定版本和该分发内包含的一组组件。 支持的 HDInsight 版本列表会不断更新,以提供最新的 Hadoop 生态系统组件和修补程序。 请确保始终参考支持的 HDInsight 版本和操作系统类型的最新信息,以确保使用的是受支持的 HDInsight 版本。
Important
目前,HDInsight 链接服务不支持 HBase、Interactive Query(Hive LLAP)、Storm。
- additionalLinkedServiceNames JSON 示例
"additionalLinkedServiceNames": [{
"referenceName": "MyStorageLinkedService2",
"type": "LinkedServiceReference"
}]
Authentication
服务主体身份验证
按需 HDInsight 链接服务要求进行服务主体身份验证,以代表你创建 HDInsight 群集。 若要使用服务主体身份验证,在 Microsoft Entra ID中注册应用程序实体,并向其授予创建 HDInsight 群集的订阅或资源组的 Contributor 角色。 有关详细步骤,请参阅 使用门户创建可访问资源的Microsoft Entra应用程序和服务主体。 记下下面的值,这些值用于定义链接服务:
- 应用程序 ID
- 应用程序密钥
- 租户 ID
通过指定以下属性使用服务主体身份验证:
| Property | Description | Required |
|---|---|---|
| servicePrincipalId | 指定应用程序的客户端 ID。 | Yes |
| servicePrincipalKey | 指定应用程序的密钥。 | Yes |
| tenant | 指定应用程序的租户信息(域名或租户 ID)。 可以通过将鼠标悬停在Azure门户右上角来检索它。 | Yes |
托管身份验证
对Azure HDInsight按需链接服务使用托管标识身份验证时,请确保托管标识对象具有对资源组的参与者角色访问权限。
除了现有的基于密钥的身份验证之外,ADLS Gen2 主存储账户现在还支持基于用户分配的托管标识(UAMI)身份验证。 UAMI 必须对主存储帐户具有 Storage Blob Data Owner 权限。
限制:
- ADLS Gen2 主存储帐户和 UAMI 必须位于与用于创建按需 HDInsight 群集的资源组相同的资源组中。
- 数据工厂中 UAMI 的凭据对象名称必须与 UAMI 名称完全匹配。
有关详细信息,请参阅 Create Azure HDInsight - Azure Data Lake Storage Gen2 - portal 和 Azure HDInsight 中的托管身份
高级属性
也可以为按需 HDInsight 群集的粒度配置指定以下属性。
| Property | Description | Required |
|---|---|---|
| coreConfiguration | 为待创建的 HDInsight 群集指定核心配置参数(如在 core-site.xml 中)。 | No |
| hBaseConfiguration | 为 HDInsight 群集指定 HBase 配置参数 (hbase-site.xml)。 | No |
| hdfsConfiguration | 为 HDInsight 群集指定 HDFS 配置参数 (hdfs-site.xml)。 | No |
| hiveConfiguration | 为 HDInsight 群集指定 hive 配置参数 (hive-site.xml)。 | No |
| mapReduceConfiguration | 为 HDInsight 群集指定 MapReduce 配置参数 (mapred-site.xml)。 | No |
| oozieConfiguration | 为 HDInsight 群集指定 Oozie 配置参数 (oozie-site.xml)。 | No |
| stormConfiguration | 为 HDInsight 群集指定 Storm 配置参数 (storm-site.xml)。 | No |
| yarnConfiguration | 为 HDInsight 群集指定 Yarn 配置参数 (yarn-site.xml)。 | No |
- 示例 - 具有高级属性的按需 HDInsight 群集配置
{
"name": " HDInsightOnDemandLinkedService",
"properties": {
"type": "HDInsightOnDemand",
"typeProperties": {
"clusterSize": 16,
"timeToLive": "01:30:00",
"hostSubscriptionId": "<subscription ID>",
"servicePrincipalId": "<service principal ID>",
"servicePrincipalKey": {
"value": "<service principal key>",
"type": "SecureString"
},
"tenant": "<tenant id>",
"clusterResourceGroup": "<resource group name>",
"version": "3.6",
"osType": "Linux",
"linkedServiceName": {
"referenceName": "AzureStorageLinkedService",
"type": "LinkedServiceReference"
},
"coreConfiguration": {
"templeton.mapper.memory.mb": "5000"
},
"hiveConfiguration": {
"templeton.mapper.memory.mb": "5000"
},
"mapReduceConfiguration": {
"mapreduce.reduce.java.opts": "-Xmx4000m",
"mapreduce.map.java.opts": "-Xmx4000m",
"mapreduce.map.memory.mb": "5000",
"mapreduce.reduce.memory.mb": "5000",
"mapreduce.job.reduce.slowstart.completedmaps": "0.8"
},
"yarnConfiguration": {
"yarn.app.mapreduce.am.resource.mb": "5000",
"mapreduce.map.memory.mb": "5000"
},
"additionalLinkedServiceNames": [{
"referenceName": "MyStorageLinkedService2",
"type": "LinkedServiceReference"
}]
}
},
"connectVia": {
"referenceName": "<name of Integration Runtime>",
"type": "IntegrationRuntimeReference"
}
}
节点大小
可使用以下属性指定头节点、数据节点和 Zookeeper 节点的大小:
| Property | Description | Required |
|---|---|---|
| headNodeSize | 指定头节点的大小。 默认值为:Standard_D3。 有关详细信息,请参阅“指定节点大小”部分。 | No |
| dataNodeSize | 指定数据节点的大小。 默认值为:Standard_D3。 | No |
| zookeeperNodeSize | 指定 ZooKeeper 节点的大小。 默认值为:Standard_D3。 | No |
- 指定节点大小请参阅虚拟机文章,了解需要为上一节中提到的属性指定的字符串值。 这些值需要符合文章中所引用的 CMDLET 和 API。 如文章中所示,大尺寸(默认)的数据节点拥有 7 GB 的内存,这可能无法满足具体方案的需求。
如果要创建 D4 大小的头节点和工作节点,请将 Standard_D4 指定为 headNodeSize 和 dataNodeSize 属性的值。
"headNodeSize": "Standard_D4",
"dataNodeSize": "Standard_D4",
如果为这些属性指定了错误的值,可能会收到以下 错误: 无法创建群集。 异常: 无法完成群集创建操作。 操作失败,代码为 '400'。 群集保持为 'Error' 状态。 消息:“PreClusterCreationValidationFailure”。 收到此错误时,请确保使用的是虚拟机的大小一文中的表中的 CMDLET 和 API 名称。
自带计算环境
在这种类型的配置中,用户可将现有的计算环境注册为链接服务。 计算环境由用户进行管理,服务使用它执行活动。
此类型的配置支持以下计算环境:
- Azure HDInsight
- Azure Batch
- Azure 机器学习
- Azure Data Lake Analytics
- Azure SQL DB、Azure Synapse Analytics、SQL Server
Azure HDInsight链接服务
可以创建 Azure HDInsight 关联服务,以向数据工厂或 Synapse 工作区注册自己的 HDInsight 群集。
使用基本身份验证的示例
{
"name": "HDInsightLinkedService",
"properties": {
"type": "HDInsight",
"typeProperties": {
"clusterUri": " https://<hdinsightclustername>.azurehdinsight.net/",
"userName": "username",
"password": {
"value": "passwordvalue",
"type": "SecureString"
},
"linkedServiceName": {
"referenceName": "AzureStorageLinkedService",
"type": "LinkedServiceReference"
}
},
"connectVia": {
"referenceName": "<name of Integration Runtime>",
"type": "IntegrationRuntimeReference"
}
}
}
使用系统分配的托管标识的示例
{
"name": "HDInsightLinkedService",
"properties": {
"type": "HDInsight",
"typeProperties": {
"clusterUri": " https://<hdinsightclustername>.azurehdinsight.net/",
"clusterAuthType": "SystemAssignedManagedIdentity",
"linkedServiceName": {
"referenceName": "AzureStorageLinkedService",
"type": "LinkedServiceReference"
}
},
"connectVia": {
"referenceName": "<name of Integration Runtime>",
"type": "IntegrationRuntimeReference"
}
}
}
使用用户分配的托管标识的示例
{
"name": "HDInsightLinkedService",
"properties": {
"type": "HDInsight",
"typeProperties": {
"clusterUri": " https://<hdinsightclustername>.azurehdinsight.net/",
"clusterAuthType": "UserAssignedManagedIdentity",
"credential": {
"referenceName": "CredentialName",
"type": "CredentialReference"
},
"linkedServiceName": {
"referenceName": "AzureStorageLinkedService",
"type": "LinkedServiceReference"
}
},
"connectVia": {
"referenceName": "<name of Integration Runtime>",
"type": "IntegrationRuntimeReference"
}
}
}
属性
| Property | Description | Required |
|---|---|---|
| 类型 | type 属性应设置为 HDInsight。 | Yes |
| clusterUri | HDInsight 群集的 URI。 | Yes |
| 用户名 | 指定用于连接到现有 HDInsight 群集的用户的名称。 | Yes |
| 密码 | 指定用户帐户的密码。 | Yes |
| linkedServiceName | Azure 存储链接服务(指 HDInsight 群集使用的 Azure Blob 存储)的名称。 目前,不能为此属性指定Azure Data Lake Storage(第 2 代)链接服务。 如果 HDInsight 群集有权访问 Data Lake 存储,则可以从 Hive/Pig 脚本访问 Azure Data Lake Storage (第 2 代)中的数据。 |
Yes |
| isEspEnabled | 如果 HDInsight 群集已启用企业安全包,则指定“true”。 默认值为“false”。 | No |
| connectVia | 用于将活动调度到此链接服务的 Integration Runtime。 可以使用 Azure 集成运行时或自托管集成运行时。 如果未指定,则使用默认Azure Integration Runtime。 对于启用了企业安全性套餐 (ESP) 的 HDInsight 群集,可以使用自承载集成运行时,该运行时具有群集的视线,或者应该与 ESP HDInsight 群集部署在同一虚拟网络内。 |
No |
| clusterAuthType | 指定 HDInsight 群集身份验证类型。 支持的身份验证类型为“BasicAuth”、“SystemAssignedManagedIdentity”、“UserAssignedManagedIdentity”。 | 使用托管身份验证所必需的。如果字段不存在,将默认使用基本身份验证。 |
| 凭据 | 指定包含 HDInsight 群集托管身份对象信息的凭据引用。 | 仅适用于“UserAssignedManagedIdentity”认证 |
Authentication
ADLS Gen2 的Azure 存储链接服务现在除了现有的身份验证方法外,还支持系统分配的托管标识和用户分配的托管标识。 默认情况下,在使用 Azure Integration Runtime (Azure IR) 时,此支持可用,并且从 5.55.9306.2 或更高版本开始,自承载 Integration Runtime (SHIR) 中支持此支持。 对于Azure Blob 存储,Azure 存储链接服务继续仅支持帐户密钥身份验证。 从版本 5.58 或更高版本开始,使用 Azure IR 且在 SHIR 上受支持时,群集托管标识身份验证现在也默认可用。 创建群集时,每个群集只能使用一个身份验证方法。 有关使用托管标识创建和管理群集的详细信息,请参阅 创建和管理具有Entra ID身份验证的 Azure HDInsight 群集
Important
HDInsight 支持多个可部署的 Hadoop 群集版本。 每个版本选项创建 Hortonworks 数据平台 (HDP) 分发的特定版本和该分发内包含的一组组件。 支持的 HDInsight 版本列表会不断更新,以提供最新的 Hadoop 生态系统组件和修补程序。 请确保始终参考支持的 HDInsight 版本和操作系统类型的最新信息,以确保使用的是受支持的 HDInsight 版本。
Important
目前,HDInsight 链接服务不支持 HBase、Interactive Query(Hive LLAP)、Storm。
Azure Batch 链接服务
Note
建议使用 Azure Az PowerShell 模块与Azure交互。 若要开始,请参阅 Install Azure PowerShell。 若要了解如何迁移到 Az PowerShell 模块,请参阅 Migrate Azure PowerShell从 AzureRM 迁移到 Az。
可以创建 Azure Batch 链接服务,以向数据工厂或 Synapse 工作区注册虚拟机 (VM) 的 Batch 池。 可以使用Azure Batch运行自定义活动。
如果不熟悉Azure Batch服务,请参阅以下文章:
- Azure Batch基础知识,提供Azure Batch服务的概述。
- New-AzBatchAccount cmdlet,用于创建Azure Batch帐户(或) Azure门户使用Azure门户创建Azure Batch帐户。 有关使用 cmdlet 的详细说明,请参阅 使用 PowerShell 管理Azure Batch帐户一文。
- New-AzBatchPool 命令用于创建Azure Batch池。
Important
创建新的Azure Batch池时,必须使用“VirtualMachineConfiguration”,而不是“CloudServiceConfiguration”。
Example
{
"name": "AzureBatchLinkedService",
"properties": {
"type": "AzureBatch",
"typeProperties": {
"accountName": "batchaccount",
"accessKey": {
"type": "SecureString",
"value": "access key"
},
"batchUri": "https://batchaccount.region.batch.azure.com",
"poolName": "poolname",
"linkedServiceName": {
"referenceName": "StorageLinkedService",
"type": "LinkedServiceReference"
}
},
"connectVia": {
"referenceName": "<name of Integration Runtime>",
"type": "IntegrationRuntimeReference"
}
}
}
属性
| Property | Description | Required |
|---|---|---|
| 类型 | type 属性应设置为 AzureBatch。 | Yes |
| accountName | Azure Batch帐户的名称。 | Yes |
| accessKey | Azure Batch帐户的访问密钥。 | Yes |
| batchUri | Azure Batch帐户的 URL,格式为 https://batchaccountname.region.batch.azure.com。 | Yes |
| poolName | 虚拟机池的名称。 | Yes |
| linkedServiceName | 此 Azure Batch 关联服务所关联的 Azure 存储 服务名称。 此链接服务用于暂存运行活动所需的文件。 | Yes |
| connectVia | 用于将活动调度到此链接服务的 Integration Runtime。 可以使用 Azure Integration Runtime 或自托管集成运行时。 如果未指定,则使用默认Azure Integration Runtime。 | No |
机器学习工作室(经典)链接服务
Important
对 Azure 机器学习工作室(经典版)的支持将于 2024 年 8 月 31 日结束。 建议按该日期转换到 Azure 机器学习。
自 2021 年 12 月 1 日起,无法创建新的机器学习工作室(经典)资源(工作区和 Web 服务计划)。 到 2024 年 8 月 31 日,可以继续使用现有的机器学习工作室(经典)试验和 Web 服务。 有关详细信息,请参阅:
机器学习工作室(经典)文档即将停用,将来可能不会更新。
可以创建机器学习工作室(经典版)链接服务,以向数据工厂或 Synapse 工作区注册机器学习工作室(经典版)批处理评分终结点。
Example
{
"name": "AzureMLLinkedService",
"properties": {
"type": "AzureML",
"typeProperties": {
"mlEndpoint": "https://[batch scoring endpoint]/jobs",
"apiKey": {
"type": "SecureString",
"value": "access key"
}
},
"connectVia": {
"referenceName": "<name of Integration Runtime>",
"type": "IntegrationRuntimeReference"
}
}
}
属性
| Property | Description | Required |
|---|---|---|
| 类型 | type 属性应设置为: AzureML。 | Yes |
| mlEndpoint | 批处理计分 URL。 | Yes |
| apiKey | 已发布的工作区模型 API。 | Yes |
| updateResourceEndpoint | ML 工作室(经典)Web 服务终结点的更新资源 URL 用于使用经过训练的模型文件更新预测性 Web 服务 | No |
| servicePrincipalId | 指定应用程序的客户端 ID。 | 如果已指定 updateResourceEndpoint,则为必需 |
| servicePrincipalKey | 指定应用程序的密钥。 | 如果已指定 updateResourceEndpoint,则为必需 |
| 租户 | 指定应用程序的租户信息(域名或租户 ID)。 可以通过将鼠标悬停在Azure门户右上角来检索它。 | 如果已指定 updateResourceEndpoint,则为必需 |
| connectVia | 用于将活动调度到此链接服务的 Integration Runtime。 可以使用 Azure Integration Runtime 或自托管 Integration Runtime。 如果未指定,则使用默认Azure Integration Runtime。 | No |
Azure 机器学习链接服务
创建Azure 机器学习链接服务,将Azure 机器学习工作区连接到数据工厂或 Synapse 工作区。
Note
目前,Azure 机器学习链接服务仅支持服务主体身份验证。
Example
{
"name": "AzureMLServiceLinkedService",
"properties": {
"type": "AzureMLService",
"typeProperties": {
"subscriptionId": "subscriptionId",
"resourceGroupName": "resourceGroupName",
"mlWorkspaceName": "mlWorkspaceName",
"servicePrincipalId": "service principal id",
"servicePrincipalKey": {
"value": "service principal key",
"type": "SecureString"
},
"tenant": "tenant ID"
},
"connectVia": {
"referenceName": "<name of Integration Runtime?",
"type": "IntegrationRuntimeReference"
}
}
}
属性
| Property | Description | Required |
|---|---|---|
| 类型 | type 属性应设置为: AzureMLService。 | Yes |
| subscriptionId | Azure订阅 ID | Yes |
| resourceGroupName | name | Yes |
| mlWorkspaceName | Azure 机器学习工作区名称 | Yes |
| servicePrincipalId | 指定应用程序的客户端 ID。 | Yes |
| servicePrincipalKey | 指定应用程序的密钥。 | Yes |
| 租户 | 指定应用程序的租户信息(域名或租户 ID)。 可以通过将鼠标悬停在Azure门户右上角来检索它。 | 如果已指定 updateResourceEndpoint,则为必需 |
| connectVia | 用于将活动调度到此链接服务的 Integration Runtime。 可以使用 Azure Integration Runtime 或自托管 Integration Runtime。 如果未指定,则使用默认Azure Integration Runtime。 | No |
Azure Data Lake Analytics链接服务
创建 Azure Data Lake Analytics 链接服务,将Azure Data Lake Analytics计算服务链接到数据工厂或 Synapse 工作区。 管道中的 Data Lake Analytics U-SQL 活动是指此链接服务。
Example
{
"name": "AzureDataLakeAnalyticsLinkedService",
"properties": {
"type": "AzureDataLakeAnalytics",
"typeProperties": {
"accountName": "adftestaccount",
"dataLakeAnalyticsUri": "azuredatalakeanalytics URI",
"servicePrincipalId": "service principal id",
"servicePrincipalKey": {
"value": "service principal key",
"type": "SecureString"
},
"tenant": "tenant ID",
"subscriptionId": "<optional, subscription ID of ADLA>",
"resourceGroupName": "<optional, resource group name of ADLA>"
},
"connectVia": {
"referenceName": "<name of Integration Runtime>",
"type": "IntegrationRuntimeReference"
}
}
}
属性
| Property | Description | Required |
|---|---|---|
| 类型 | type 属性应设置为: AzureDataLakeAnalytics。 | Yes |
| accountName | Azure Data Lake Analytics帐户名称。 | Yes |
| dataLakeAnalyticsUri | Azure Data Lake Analytics URI。 | No |
| subscriptionId | Azure订阅 ID | No |
| resourceGroupName | Azure资源组名称 | No |
| servicePrincipalId | 指定应用程序的客户端 ID。 | Yes |
| servicePrincipalKey | 指定应用程序的密钥。 | Yes |
| 租户 | 指定应用程序的租户信息(域名或租户 ID)。 可以通过将鼠标悬停在Azure门户右上角来检索它。 | Yes |
| connectVia | 用于将活动调度到此链接服务的 Integration Runtime。 可以使用 Azure 整合运行时或自承载整合运行时。 如果未指定,则使用默认Azure Integration Runtime。 | No |
Azure Databricks链接服务
可以创建 Azure Databricks 链接服务来注册用于运行 Databricks 工作负荷(笔记本、jar、python)的 Databricks 工作区。
Important
Databricks 关联服务支持 实例池 和系统分配的托管标识身份验证。
示例 - 在 Databricks 中使用新的作业群集
{
"name": "AzureDatabricks_LS",
"properties": {
"type": "AzureDatabricks",
"typeProperties": {
"domain": "https://eastus.azuredatabricks.net",
"newClusterNodeType": "Standard_D3_v2",
"newClusterNumOfWorker": "1:10",
"newClusterVersion": "4.0.x-scala2.11",
"accessToken": {
"type": "SecureString",
"value": "YourAccessToken"
}
}
}
}
示例 - 在 Databricks 中使用现有的交互式群集
{
"name": " AzureDataBricksLinkedService",
"properties": {
"type": " AzureDatabricks",
"typeProperties": {
"domain": "https://westeurope.azuredatabricks.net",
"accessToken": {
"type": "SecureString",
"value": "YourAccessToken"
},
"existingClusterId": "{clusterId}"
}
}
属性
| Property | Description | Required |
|---|---|---|
| name | 链接服务的名称 | Yes |
| 类型 | type 属性应设置为:Azure Databricks。 | Yes |
| 域 | 根据 Databricks 工作区的区域相应地指定Azure区域。 示例:https://eastus.azuredatabricks.net | Yes |
| accessToken | 服务需要访问令牌才能对Azure Databricks进行身份验证。 需要从 databricks 工作区生成访问令牌。 可以在这里找到更详细的步骤来查找访问令牌。 | No |
| MSI | 使用系统分配的托管标识对Azure Databricks进行身份验证。 使用“MSI”身份验证时,无需Access令牌。 有关托管标识身份验证的更多详细信息,请参阅 此处 | No |
| existingClusterId | 现有群集的群集 ID,用于在其上运行所有作业。 该群集应该是已创建的交互式群集。 如果群集停止响应,则可能需要手动重启该群集。 Databricks 建议在新群集上运行作业,以提高可靠性。 可以通过 Databricks 工作区 ->“群集”->“交互式群集名称”->“配置”->“标记”找到交互式群集的群集 ID。 更多详细信息 | No |
| instancePoolId | Databricks 工作区中现有池的实例池 ID。 | No |
| newClusterVersion | 群集的 Spark 版本。 它会在 Databricks 中创建作业群集。 | No |
| newClusterNumOfWorker | 此群集应该拥有的工作节点的数目。 群集有一个 Spark 驱动程序和 num_workers 个执行器,总共有 num_workers + 1 个 Spark 节点。 字符串格式的 Int32,例如“1”是指 numOfWorker 为 1,“1:10”是指自动缩放的范围为 1 到 10。 | No |
| newClusterNodeType | 此字段通过单个值对提供给此群集中的每个 Spark 节点的资源进行编码。 例如,可以针对内存或计算密集型工作负载对 Spark 节点进行预配和优化。 此字段是新群集必需的 | No |
| newClusterSparkConf | 一组可选的、用户指定的 Spark 配置键值对。 用户还可以分别通过 spark.driver.extraJavaOptions 和 spark.executor.extraJavaOptions 将包含额外 JVM 选项的字符串传递给驱动程序和执行器。 | No |
| newClusterInitScripts | 新群集的一组可选的、用户定义的初始化脚本。 可以在工作区文件(建议)中或通过 DBFS 路径(旧版)指定初始化脚本。 | No |
Azure SQL 数据库链接服务
创建一个 Azure SQL 链接服务,并将其与 存储过程活动 一起使用,以通过管道调用存储过程。 有关此链接服务的详细信息,请参阅 Azure SQL Connector 一文。
Azure Synapse Analytics 链接服务
创建Azure Synapse Analytics链接的服务,并将其与 Stored Procedure Activity 一起使用,以从管道调用存储过程。 有关此链接服务的详细信息,请参阅 Azure Synapse Analytics Connector 一文。
SQL Server-链接服务
创建一个SQL Server链接的服务,并将其与存储过程活动一起使用,以从管道中调用存储过程。 有关此链接服务的详细信息,请参阅 SQL Server connector 一文。
Azure Synapse Analytics (Artifacts) 链接服务
创建Azure Synapse Analytics(Artifacts)链接服务并将其与 Synapse Notebook 活动和Synapse Spark 作业定义活动一起使用。
Example
{
"name": "AzureSynapseArtifacts",
"type": "Microsoft.DataFactory/factories/linkedservice",
"properties": {
"properties": {
"a":{
"type": "String"
}
},
"annotations": [],
"type": "AzureSynapseArtifacts",
"typeProperties": {
"endpoint": "@{linkedService().a}",
"authentication": "MSI",
"workspaceResourceId": ""
},
"ConnectVia":{
"referenceName": "integrationRuntime1",
"type": "IntegrationRuntimeReference"
}
}
}
属性
| Property | Description | Required |
|---|---|---|
| name | 链接服务的名称 | Yes |
| description | 链接服务的说明 | No |
| annotations | 链接服务的注释 | No |
| 类型 | type 属性应设置为 AzureSynapseArtifacts | Yes |
| 终结点 | Azure Synapse Analytics 网址 | Yes |
| 身份验证 | 默认设置是系统分配的托管标识 | Yes |
| workspaceResourceId | 工作区资源 ID | Yes |
| connectVia | 用于连接到数据存储的集成运行时。 可以使用Azure Integration Runtime。 如果未指定,则使用默认Azure Integration Runtime。 目前不支持自托管集成运行时。 | Yes |
Azure函数链接服务
创建 Azure Functions 关联服务,并将其与 Azure 函数活动 一起使用,以便在管道中运行 Azure Functions。 Azure 函数的返回类型必须是有效的 JObject。 (请记住:JArray 不是 JObject。)JObject 以外的任何返回类型都会失败,并引发用户错误“响应内容不是有效的 JObject”。
| Property | Description | Required |
|---|---|---|
| 类型 | type 属性必须设置为: AzureFunction | yes |
| 函数应用 URL | Azure Function App 的 URL。 格式为 https://<accountname>.azurewebsites.net。 在 Azure 门户中查看 Function App 时,此 URL 是 URL 节下的值 |
yes |
| 函数键 | Azure函数的访问密钥。 单击相应函数的 “管理 ”部分,复制 函数密钥 或 主机密钥。 在此处了解详细信息:使用访问密钥 | yes |
相关内容
有关支持的转换活动的列表,请参阅 转换数据。