Azure 数据工厂 - FTP 链接服务中的动态主机名
Azure Data Factory - Dynamic host name in FTP Linked Service
全部,
如果这是一个微不足道的查询,请原谅我。我在 ADF 中使用 FTP 链接服务,我需要动态使用 FTP 主机名。我需要在数百个 FTP 服务器上工作,创建数百个链接服务绝对不是一个好主意。
在大多数链接服务中,有一个动态内容选项,但对于 FTP 链接服务,我没有看到它。有没有一种方法可以动态传递 FTP 主机名,从而避免创建数百个链接服务。
感谢您对此的帮助。
是的,你可以在JSON格式中指定动态内容:
这是允许动态链接服务参数的Json代码:
{
"properties": {
"type": "sftp",
"parameters": {
"HostName": {
"type": "string",
"defaultValue": ""
},
"UserName": {
"type": "string",
"defaultValue": ""
},
"Port": {
"type": "string",
"defaultValue": ""
},
"SecretName": {
"type": "string",
"defaultValue": ""
}
},
"annotations": [],
"typeProperties": {
"host": "@linkedService().HostName",
"userName": "@linkedService().UserName",
"port": "@linkedService().Port",
"skipHostKeyValidation": true,
"authenticationType": "Basic",
"password": {
"type": "AzureKeyVaultSecret",
"store": {
"referenceName": "KEYVAULT_Ops",
"type": "LinkedServiceReference"
},
"secretName": "@linkedService().SecretName"
}
}
}
}
这里重要的是第一部分:
"parameters": {
"HostName": {
"type": "string",
"defaultValue": ""
},
"UserName": {
"type": "string",
"defaultValue": ""
},
"Port": {
"type": "string",
"defaultValue": ""
},
"SecretName": {
"type": "string",
"defaultValue": ""
}
},
然后您可以像这样在 json 中引用这些参数:
这是为该链接服务创建数据集时的样子:
全部, 如果这是一个微不足道的查询,请原谅我。我在 ADF 中使用 FTP 链接服务,我需要动态使用 FTP 主机名。我需要在数百个 FTP 服务器上工作,创建数百个链接服务绝对不是一个好主意。
在大多数链接服务中,有一个动态内容选项,但对于 FTP 链接服务,我没有看到它。有没有一种方法可以动态传递 FTP 主机名,从而避免创建数百个链接服务。
感谢您对此的帮助。
是的,你可以在JSON格式中指定动态内容:
这是允许动态链接服务参数的Json代码:
{
"properties": {
"type": "sftp",
"parameters": {
"HostName": {
"type": "string",
"defaultValue": ""
},
"UserName": {
"type": "string",
"defaultValue": ""
},
"Port": {
"type": "string",
"defaultValue": ""
},
"SecretName": {
"type": "string",
"defaultValue": ""
}
},
"annotations": [],
"typeProperties": {
"host": "@linkedService().HostName",
"userName": "@linkedService().UserName",
"port": "@linkedService().Port",
"skipHostKeyValidation": true,
"authenticationType": "Basic",
"password": {
"type": "AzureKeyVaultSecret",
"store": {
"referenceName": "KEYVAULT_Ops",
"type": "LinkedServiceReference"
},
"secretName": "@linkedService().SecretName"
}
}
}
}
这里重要的是第一部分:
"parameters": {
"HostName": {
"type": "string",
"defaultValue": ""
},
"UserName": {
"type": "string",
"defaultValue": ""
},
"Port": {
"type": "string",
"defaultValue": ""
},
"SecretName": {
"type": "string",
"defaultValue": ""
}
},
然后您可以像这样在 json 中引用这些参数:
这是为该链接服务创建数据集时的样子: