0
votes

All, Please pardon me if this is a trivial query. I am using FTP linked service in ADF and I need to use the FTP host name dynamically. I need to work on hundreds of FTP servers and creating hundreds of linked services is definitely not a good idea.

In most of the linked services, there is an option of dynamic content but for FTP linked service I don't see it. Is there a way that I could pass the FTP host name dynamically thus avoid creating hundreds of linked services.

Thanks for your help on this.

enter image description here

1

1 Answers

0
votes

Yes, you can do it specifying dynamic contents in JSON Format:

SFTP Linked Service Example

Here is the Json code that allows for dynamic linked service parameters:

{
    "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"
            }
        }
    }
}

The important part here is the first part:

"parameters": {
            "HostName": {
                "type": "string",
                "defaultValue": ""
            },
            "UserName": {
                "type": "string",
                "defaultValue": ""
            },
            "Port": {
                "type": "string",
                "defaultValue": ""
            },
            "SecretName": {
                "type": "string",
                "defaultValue": ""
            }
        },

You can then reference these parameters in the json like this: LinkedService Parameter example

This is what it looks like when creating the dataset for that linked service: Dataset Illustration showing Linked Service Parameters