BizCrypto adapters for BizTalk server can be used to automate secure file uploads. A simple automating application can be created without writing code at all. Let's create the application that monitors the "C:\Upload\" directory and uploads all the found files to the SFTP server.
First of all, open BizTalk Administration Console (all the further explanation concerns Microsoft BizTalk 2006 server) and expand the BizTalk Server Administration - BizTalk Group node in the Console Root tree view.
Create new BizTalk application
- Right-click on the Applications node and choose New->Application menu item.
- Specify the name for your application (e.g., "Simple SFTP uploader") and click OK. The corresponding application node will be added to the Applications subtree.
Create a receive locationThe task of receive location is monitoring the "C:\Upload\" directory and initiating the execution of the application if some files were encountered there.
- Expand the Applications - Simple SFTP uploader node and go to the Receive Ports item.
- Right click on the [empty] surface on the right and choose New -> One-way receive port item from a menu.
- In the opened Receive Port Properties window specify a name for the port (e.g., "FileReceivePort"), and then go to the Receive Locations tab. Click New button.
- In the opened Receive Location Properties window specify a name for the receive location (e.g., "FileReceiveLocation"). In the Type combo box choose the "FILE" item and click Configure button. In the opened FILE Transport Properties window specify the desired read folder ("C:\Upload") and the file mask. Click OK.
- close Receive Location Properties and Receive Port Properties dialogs by clicking OK buttons on both.
Create a send portSend port is responsible for sending messages to a remote server via SFTP protocol.
- Go to the Send Ports item in the Applications - Simple SFTP uploader node.
- Right click on the [empty] surface on the right and choose New -> Static one-way send port item from a menu.
- In the opened Send Port Properties window specify a name for the port (e.g., "SFTPSendPort").
- In the Type combo box choose the "SFTP" item (the exact name may differ and depends on the name that was specified when the adapter has been installed to the BizTalk server) and click Configure button. In the opened Adapter Properties dialog specify the necessary connection properties, such as remote server address, username, password and the location where to put the uploaded file. When everything is ready, click OK.
Creating a filterBy themselves, the receive port does not know what to do with the files detected, and the send port does not know that there are files to be processed. Filter is needed to create a correspondence between created receive and send ports, so that the send port could take the files read by the receive port and upload them to the server.
- Go to the Filters tab.
- In the Property combo box choose the BTS.ReceivePortName entry. Ensure that the Operator value is "==" (this value is set by default).
- In the Value cell type the name of the receive port you have created on step 2 ("FileReceivePort").