I will start directly with my question: Is it possible to connect to an on Premise Dataset in a Azure Data Factory Custom Activity via Data Management Gateway?
The usecase:
I have a local FTP Server, with multiple files on it, which should be regulary copied to an Azure Blob Storage. The decision which files have to be uploaded should be based on a custom trigger. Therefore I am building a Data Factory custom activity, instead of a normal copy activity. The server should only be accessed via the data management gateway
I created an FTPServer typed linked service, and a FileShare Dataset. This I used inside my CustomActivity Pipeline as Input.
Inside my custom activity, I now want to connect to the input dataset and get the content of a folder inside the ftp server. And here I am not getting forward. I don´t get how to connect to the ftp server. Here is the code element I am stuck at:
public IDictionary<string, string> Execute(IEnumerable<LinkedService> linkedServices,IEnumerable<Dataset> datasets,
Activity activity,IActivityLogger logger)
{
Dataset inputDataset = datasets.Single(dataset => dataset.Name == activity.Inputs.Single().Name);
FileShareDataset inputTypeProperties = inputDataset.Properties.TypeProperties as FileShareDataset;
FtpServerLinkedService inputLinkedService = linkedServices.First(linkedService =>
linkedService.Name ==
inputDataset.Properties.LinkedServiceName).Properties.TypeProperties
as FtpServerLinkedService;
***//HERE CONNECTION TO FTPSERVER VIA GATEWAY***
}
There are multiple Gateway classes in Microsoft.Azure.Management.DataFactories.Models
but i can´t find a way to work with them. For me it looks like that the data management gateway is maybe not supported for a custom activity? If that is correct, are there some other ways to go, like creating a copy activity inside the custom activity or things like that? Or is the only possible solution a direct connection to the FTP-Server via WebRequest?