Data Factory > protocol-ftp-move β
TL;DR;
This task allows moving one or more files present on the same FTP/SFTP server.
Name:
Max execution time: 120 mins
Target β
Move one or more files on the same FTP/SFTP server
Example of use in a job β
- Move a file after it has been processed
1. FTP Get Retrieve the last file that ends with -table.xml
2. Import Table Import
3. XSLT Define the files to move
4. FTP Move Move the recovered file1
2
3
4
2
3
4
- Move all the command files that have been processed
1. FTP List List the command files on the MFT
2. XSLT Filter the files of the current week
3. FTP Get Retrieve files
4. CSV to XML Transform all order files into an XML file
5. XSLT Build the command file
6. Import Items Import orders
7. XSLT Define the files to move
8. FTP Move Move processed files1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
Inputs and Outputs β
json
{
"name": "protocol-ftp-move",
"taskReferenceName": "ftp_move",
"description": "The business description of the task",
"type": "SUB_WORKFLOW",
"optional": false,
"inputParameters": {
"connection": "SFTP",
"host": "",
"username": "",
"password": "",
"port": 21,
"request": "${b.output.file}"
}
}1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Inputs β
TIP
If at least one task parameters (whether mandatory or not) is invalid, task execution is stopped and the returned status is FAILED. For example:
- The proposed value for the
connectionproperty is invalid.
| Property | Description |
|---|---|
connection | Mandatory - Enum - FTP, SFTP, FTPS |
authenticationMethod | Enum - PASSWORD, PUBLIC_KEY (only available if connection = SFTP), Default: PASSWORDIf mode != SFTP and authenticationMethod = PUBLIC_KEY, the task fails. |
host | Mandatory β String |
privateKey | Mandatory if authenticationMethod=PUBLIC_KEY - StringIt is strongly recommended to use a secret variable to store the private key. |
passphrase | String Only taken into account if authenticationMethod= PUBLIC_KEY. |
username | Mandatory - String |
password | Mandatory if connection != SFTP, if connection == SFTP and password is set then an invalid input error is added - String |
port | Mandatory - Number |
request | Mandatory - File An XML file describing the path of the files to be moved |
TIP
The supported private keys are the following :
---- BEGIN SSH2 PUBLIC KEY ---------BEGIN RSA PRIVATE KEY----------BEGIN DSA PRIVATE KEY----------BEGIN EC PRIVATE KEY-----PuTTY-User-Key-File-2: (ssh-rsa)PuTTY-User-Key-File-2: (ssh-dss)-----BEGIN OPENSSH PRIVATE KEY-----
Les sorties β
| Property | Description |
|---|---|
allFilesMoved | Enum - YES, NOIf all files could be moved: YES otherwise NO. |
Details regarding the request document β
xml
<Ftp-Move>
<File>
<Source-Path>/products-1.csv</Source-Path>
<Target-Path>/processed/products-1.csv</Target-Path>
</File>
<File>
<Source-Path>/sub-folder/products-2.csv</Source-Path>
<Target-Path>/processed/products-2.csv</Target-Path>
</File>
</Ftp-Move>1
2
3
4
5
6
7
8
9
10
2
3
4
5
6
7
8
9
10
| XPath | Description | Occurrence |
|---|---|---|
Ftp-Move | Root | 1 |
File | For each file to be moved | 0..* |
Source-Path | The full path. Subfolders are separated by the / character. | 1 |
Target-Path | The full path. Subfolders are separated by the / character. | 1 |
Limitations connues β
- For SFTP connections, only the following ciphers are allowed:
aes256-cbc,aes192-cbc,aes128-cbc,blowfish-cbc,3des-cbc,aes128-gcm,aes256-gcm,arcfour256,arcfour128,cast128-cbc,arcfour.
Appendices β
- Jobs example: data-factory-job-collection/By Tasks/protocol-ftp-move