How To Automatically Transfer Files From SFTP To Azure Blob Storage Via Network Storage

Posted by John Carl Villanueva on Thu, Jan 28, 2021 @ 04:31 AM

Let's say you have trading partners who can only transfer files to you via SFTP. Incidentally, you also happen to have an account on Azure Blob Storage and you prefer to store those files there. You're probably thinking: How can I automatically copy files from my SFTP server to Azure Blob Storage? That's easy if you're using JSCAPE MFT Server.

automatically transfer files from sftp to azure blob storage - blog thumb

There are a couple of ways of doing this using JSCAPE MFT Server and I'm going to show you two of them. In the first method, which I'm going to demonstrate in this post, I'm going to assume you want all your SFTP file uploads from the trading partners in question to be transferred directly to the Azure Blob Storage folder upon upload.

Would you prefer to watch a video showing how to automatically transfer files from SFTP to Azure Blob via network storage? If so, you may play the video below. Otherwise, just continue reading.

 

 

Getting Started

First we'll need to set up a network storage object for that Azure Blob Storage folder and a virtual path that maps to that network storage. From your trading partners' point of view, that virtual path will appear just like a regular folder when, in fact, it actually maps to the Azure Blob Storage folder. 

Before we head to our JSCAPE MFT Server manager, let me first show you what I have on Azure Blob Storage. So, I have an Azure blob named 'jcpv-test' and, inside it, a folder named 'folder1'. That's where I'm going to store all the SFTP file uploads.

 

automatically transfer files from sftp to azure blob storage - 01

 

Ok. Let's now head over to our JSCAPE MFT Server instance and login to the JSCAPE MFT Server manager. Notice that, in my Services module, I already have an SFTP service running. We need that service because that's what our trading partners will be using to upload files to us.

 

automatically transfer files from sftp to azure blob storage - 02

 

With our SFTP service ready, we now proceed to our Network Storage module. Click Add to add a new network storage object.

 

automatically transfer files from sftp to azure blob storage - 03

 

Next, select Microsoft Azure Blob Service and then click OK.

 

automatically transfer files from sftp to azure blob storage - 04

 

We now need to enter the parameters for this network storage object. Start by entering the name. This will be used to identify this network storage on this JSCAPE MFT Server instance. In my case, I'll just enter ns-azure blob

Next, enter your Azure storage account name as well as its corresponding access key.

 

automatically transfer files from sftp to azure blob storage - 05

 

You'll also need to enter the remote directory on your Azure Blob Storage. In our case, if you recall, we have a folder named 'folder1' inside the Azure Blob named 'jcpv-test'. So, we just enter 'jcpv-test/folder1'. 

 

automatically transfer files from sftp to azure blob storage - 06

 

We can then click the Test Server button to test our connection. If there's a problem, you'll get a message box describing it. So, for example, I'm getting a message that says 'The account being accessed does not support HTTP'. That usually means that we need to configure this network storage object to use SSL/TLS. 

 

automatically transfer files from sftp to azure blob storage - 07

 

To do that, just scroll back up and tick the Use SSL check box. 

 

automatically transfer files from sftp to azure blob storage - 088

 

Let's click that Test Server button again. If all goes well, you should see a message saying the 'Network Storage test passed'. 

 

automatically transfer files from sftp to azure blob storage - 09

 

And once you click the OK button in the parameters dialog, you'll be brought back to the main screen, where you should see your newly created Azure Blob network storage object. 

 

automatically transfer files from sftp to azure blob storage - 10

 

Now that we have our network storage object ready, the next step is to map this network storage with a virtual path. We have two options here. We can map it to a user's virtual path or to a group's virtual path. 

In most of our tutorials, we've been mapping network storage objects to a user's virtual path. This time let's map this network storage to a group's virtual path for a change. If you're not familiar with groups, I suggest you read this page in the online documentation. 

Note: In a production environment, you will probably want to segregate files belonging to different user accounts. In that case, it might be more appropriate to map each network storage object to a specific user account instead of a group. 

For this example, we have two user accounts, 'tp1' and 'tp2'. Once we have our group ready, we'll be assigning these user accounts to that group.

 

automatically transfer files from sftp to azure blob storage - 11

 

To create a group, just go to the Groups module and click the Add button.

 

automatically transfer files from sftp to azure blob storage - 12

 

Give the group a name, say for example, 'sftp to azure group'. 

Next, specify a virtual path for this group. For example, '/sftptoazure'. So, whenever a member user account of this group logs in to our server, that user will find a virtual path named 'sftptoazure' under its root virtual path. 

To map this virtual path to our Azure Blob network storage object, we simply tick the Network Storage option button and select the network storage object in question from the drop-down list. 

Once you're done here, click OK.

 

automatically transfer files from sftp to azure blob storage - 13-1

 

You should then see your newly created group in the Groups module. For our last step, we just need to add our two users to this group. To do that, just click the Users button.

 

automatically transfer files from sftp to azure blob storage - 14

 

Then select the users you wish to add. So, in our case, that would be tp1 and tp2. Click OK to proceed.

Note that all members of this group will initially have equal permissions to the virtual path. You might want to apply some restrictions in a production environment. For example, you might want to limit user permissions to just uploads or any other functionality. For more information about virtual path permissions read this page in the online documentation. 

 

automatically transfer files from sftp to azure blob storage - 15

 

Now we're ready to try this. Let's launch our file transfer client and connect to our SFTP service using login credentials of one of our trading partner user accounts. Let's just use tp1 for this example. 

 

automatically transfer files from sftp to azure blob storage - 16

 

Once tp1 logs in, the folder named 'sftptoazure', which is the virtual path mapped to our Azure Blob network storage, should be visible right away from tp1's root path. 

 

automatically transfer files from sftp to azure blob storage - 17

 

If we navigate into that virtual path, we should see exactly the same files we saw earlier in our Azure Blob storage folder.

 

automatically transfer files from sftp to azure blob storage - 18

 

And if we upload a file to that folder:

 

automatically transfer files from sftp to azure blob storage - 19

 

automatically transfer files from sftp to azure blob storage - 20

 

Then check inside the Azure file storage, we should see the newly uploaded file there. 

 

automatically transfer files from sftp to azure blob storage - 21

 

That's it. Now you know how to configure JSCAPE MFT Server so it can automatically transfer files from SFTP to Azure Blob Storage. 

For my second use case, which I'm going to illustrate in a separate post, I'm going to assume what you actually want is to have your SFTP server store those files locally first and then forward those files to Azure Blob Storage at a later time. Stay tuned for that. 

 


Get Your Free Trial

 

Would you like to try this yourself? JSCAPE MFT Server is platform-agnostic and can be installed on Microsoft Windows, Linux, Mac OS X and Solaris, and can handle any file transfer protocol as well as multiple protocols from a single server. Additionally, JSCAPE enables you to handle any file type, including batch files and XML. Download your free 7-day trial of JSCAPE MFT Server now.

 

Get A Free Trial

 

Related Content

How To Transfer Files Between Cloud Storage Services
How To Auto Upload Files To A Server From A Local Directory
How To Set Up Automated AS2 File Transfers
How To Automate An SFTP File Transfer

 

 

  

Topics: JSCAPE MFT Server, Managed File Transfer, Business Process Automation, Tutorials, Secure File Transfer, SFTP