--- title: "Set up file action - SFTP" slug: "set-up-file-action-sftp" description: "Learn how to set up SFTP file actions for secure file exchange, including downloading, uploading, and managing environment-specific properties." tags: ["Task topic"] updated: 2026-09-01T11:10:33Z published: 2026-09-01T11:10:33Z canonical: "docs.staedean.com/set-up-file-action-sftp" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.staedean.com/llms.txt > Use this file to discover all available pages before exploring further. # Set up file action - SFTP You can use the **SFTP** file action to exchange files with an SFTP server. If the direction is: - **Source**, before the message is run, the file is downloaded from the SFTP server to the **Working** folder. By default, the original file is deleted from the SFTP server. You can disable the delete action of the original file. - **Target**, after the message is run, the file is uploaded from the **Working** folder to the SFTP server. The original file stays in the **Working** folder. If you want to zip the file before uploading it to the SFTP server, do a **Zip** file action previously to the **SFTP** file action. In this case the zipped file is uploaded to the SFTP server. > [!NOTE] > Note > > You can set up file actions for these connector types: > > - **Azure file storage** > - **Azure File Storage (API)** > - **Azure Blob storage** > - **SharePoint** ### Steps 1. Click **Connectivity studio - Integration Design**. 2. Click the **Connectors** tab. 3. In the list, find and select the desired connector. 4. Click **Edit**. 5. You can export the connectivity setup and import it into another D365 F&SCM environment. For example, you first set up and test the connectivity setup in a development environment. When finished, you deploy the setup in your production environment. To protect your production data, use different file locations for your development or testing environment and for your production environment. To strictly distinguish between different environments, you can define unique file action properties for each of your environment types. So, each file action can have a different set of properties for each applicable environment type. Which file action properties are applicable to the current environment is defined in the **Environment type** field on the **Connectivity studio parameters**. **Example**: If set to **Development**, the file action properties, as defined for environment type **Development** are applicable. In the **Environment types** field, select an option. > [!NOTE] > **Note** > > For each file action, you can repeat the sub-tasks for each of your environment types. To set the environment-specific properties of a file action, only change the environment type, find the file action, and set the properties. So, do not create a new file action for each environment type. 6. Expand the **File action** section. 7. Sub-task: Set up an **SFTP** file action with direction **Source**. 1. Click **New**. 2. In the **Name** field, type a value. 3. In the **File action** field, select **SFTP**. 4. Click **Save**. 5. In the **Direction** field, select **Source**. 6. Define the name of the file to be downloaded from the SFTP server to the Working folder. You can use filtering symbols. **Example:** CustGroup*.txt. In the **File name** field, type a value. 7. You can (temporarily) disable a file action. **Example:** In a test setup, the setup to do the file action is not available. To prevent errors during test runs of the message, you disable the file action. In this way, you do not have to change or delete the file action. In the **Skip** field, select an option. 8. Define the SFTP server address. In the **Server** field, type a value. 9. Define the SFTP port. Typically, this is port 22. In the **Port** field, enter a number. 10. You can define from which folder on the SFTP server the files must be downloaded. In the **Folder** field, type a value. 11. Define the username that is used to access the SFTP server. In the **User name** field, type a value. 12. Define the password or password reference that is used to access the SFTP server. Whether the password or password reference applies is defined by the **Display secret** field in the **Connectivity studio parameters**. If the **Display secret** parameter is set to: - **Secret**, fill in the **Password** field with the desired password. The password is specific for the current file action. - **Secret reference**, fill in the **Password reference** field with the desired secret reference. The password reference refers to a centrally stored password which makes updating secrets easier. - **Both**, fill in either the **Password** field or the **Password reference** field. In the **Password** field or in the **Password reference** field, type a value. 13. Upload the private key certificate for the SFTP server from a file or enter the private key reference that refers to the desired certificate. Whether the private key or private key reference applies is defined by the **Display secret** field in the **Connectivity studio parameters**. If the **Display secret** parameter is set to: - **Secret**, upload the private key certificate. The private key is specific for the current file action. - **Secret reference**, fill in the **Private key reference** field with the desired secret reference. The private key reference refers to a centrally stored private key certificate which makes updating secrets easier. - **Both**, either upload the private key certificate or fill in the **Private key reference** field. Click **Upload private key** and browse for the file that contains the private key certificate. Or, in the **Private key reference** field, type or select a value. 14. Click **OK**. 15. Define the applicable SFTP passphrase or passphrase reference. Whether the passphrase or passphrase reference applies is defined by the **Display secret** field in the **Connectivity studio parameters**. If the **Display secret** parameter is set to: - **Secret**, fill in the **Passphrase** field with the desired SFTP passphrase . The passphrase is specific for the current file action. - **Secret reference**, fill in the **Passphrase reference** field with the desired secret reference. The passphrase reference refers to a centrally stored passphrase which makes updating secrets easier. - **Both**, fill in either the **Passphrase** field or the **Passphrase reference** field. In the **Passphrase** field or in the **Passphrase reference** field, type a value. 16. By default, on download, the original file is deleted from the SFTP server. However, you can disable the delete action of the original file. So, the original file stays in the Working folder of the SFTP server. Select **Yes** in the **Disable delete** field. 8. Sub-task: Set up an **SFTP** file action with direction **Target**. 1. Click **New**. 2. In the **Name** field, type a value. 3. In the **File action** field, select **SFTP**. 4. Click **Save**. 5. In the **Direction** field, select **Target**. 6. Click **Save**. 7. You can (temporarily) disable a flow action. **Example:** In a test setup, the setup to do the file action is not available. To prevent errors during test runs of the message, you disable the file action. In this way, you do not have to change or delete the file action. In the **Skip** field, select an option. 8. Define the SFTP server address. In the **Server** field, type a value. 9. Define the SFTP port. Typically, this is port 22. In the **Port** field, enter a number. 10. You can define to which folder on the SFTP server the files must be uploaded. In the **Folder** field, type a value. 11. Define the username that is used to access the SFTP server. In the **User name** field, type a value. 12. Define the password or password reference that is used to access the SFTP server. Whether the password or password reference applies is defined by the **Display secret** field in the **Connectivity studio parameters**. If the **Display secret** parameter is set to: - **Secret**, fill in the **Password** field with the desired password. The password is specific for the current file action. - **Secret reference**, fill in the **Password reference** field with the desired secret reference. The password reference refers to a centrally stored password which makes updating secrets easier. - **Both**, fill in either the **Password** field or the **Password reference** field. In the **Password** field or in the **Password reference** field, type a value. 13. Upload the private key certificate for the SFTP server from a file or enter the private key reference that refers to the desired certificate. Whether the private key or private key reference applies is defined by the **Display secret** field in the **Connectivity studio parameters**. If the **Display secret** parameter is set to: - **Secret**, upload the private key certificate. The private key is specific for the current file action. - **Secret reference**, fill in the **Private key reference** field with the desired secret reference. The private key reference refers to a centrally stored private key certificate which makes updating secrets easier. - **Both**, either upload the private key certificate or fill in the **Private key reference** field. Click **Upload private key** and browse for the file that contains the private key certificate. Or, in the **Private key reference** field, type or select a value. 14. Click **OK**. 15. Define the applicable SFTP passphrase or passphrase reference. Whether the passphrase or passphrase reference applies is defined by the **Display secret** field in the **Connectivity studio parameters**. If the **Display secret** parameter is set to: - **Secret**, fill in the **Passphrase** field with the desired SFTP passphrase . The passphrase is specific for the current file action. - **Secret reference**, fill in the **Passphrase reference** field with the desired secret reference. The passphrase reference refers to a centrally stored passphrase which makes updating secrets easier. - **Both**, fill in either the **Passphrase** field or the **Passphrase reference** field. In the **Passphrase** field or in the **Passphrase reference** field, type a value. 16. Define the data type that is used by the SFTP server. In the **Data type** field, select an option. 17. You can upload a file to the SFTP server with a specific file name or to a specific file, instead of using the original file name. In the **Target file name** field, type a value. 18. Define the file open mode for uploading files to the SFTP server. In the **File open mode** field, select an option. 19. Close the page. > [!NOTE] > **Notes** > > File actions of type **FTP** are no longer supported because of security reasons. Instead, use file actions of type **SFTP**. ## Related - [Set up secret references](/set-up-secret-references.md) - [Solve SFTP connection issue with private key](/solve-sftp-connection-issue-with-private-key.md)