VSharma
VSharma

Reputation: 358

Fetching files from FTP server via Azure webjobs

Recently I came across one of the requirements to read .csv files from FTP server and made them available to external system for processing. The system should read as soon as file is available on FTP server.

I thought about the solution, 1. FTP Server --> 2. Custom Windows service used as poller to know whether a new file has came--> 3. Put a message in a queue --> 4. external system as subscriber to queue.

Now I am thinking that whether Azure webjobs/functions can be used here in place of custom windows service as external system is already in Azure.

Any explanation with configuration setting are needed/expected..

Upvotes: 0

Views: 1349

Answers (2)

Stef Heyenrath
Stef Heyenrath

Reputation: 9860

In case you want to use Ftp in an Azure Function, you could also use this NuGet WebJobs.Extensions.Ftp.

This is an extension for WebJobs which uses FluentFTP to support:

  • Ftp Trigger on a new FtpFile, FtpFile[], FtpStream and FtpStream[]
  • Ftp Bindings on: IAsyncCollector, IFtpClient, FtpFile and FtpStream

See the readme from the project https://github.com/StefH/WebJobs.Extensions.Ftp on how to use it.

Upvotes: 0

evilSnobu
evilSnobu

Reputation: 26424

Sure you can. WebJobs can either run continuously or on a cron-like schedule. Write a Console Application instead of a Windows Service. That being said, there's an easier way to implement your workflow - Logic Apps:

logic_app_put_message

If you need a step that you can't implement in Logic Apps, just use the HTTP connector and call an Azure Function or check this out for a more elaborate flow.

Upvotes: 2

Related Questions