<!-- SFTP -->
<!-- canonical: https://yres.eu/en/wiki/integraties/bronnen/sftp -->
# SFTP

**Category:** File  ·  from v1.57

From v1.57 you load files from an SFTP server straight into your data warehouse. Yres connects over SSH
and signs in with a user name and password or with an SSH key. In Azure Data Factory the source becomes an
`Sftp` linked service.

## Expected input

You pick the source in **Data sources** via **Create source** under **File › SFTP**. Besides the fields that
apply to every source (source name, type, integration runtime, whether the credentials are the same for all
environments, an optional credential expiry date, tags), the SFTP form asks for the following fields:

| Field | Notes |
|---|---|
| **Host** | The host name of the SFTP server, for example `sftp.example.com`. |
| **Port** | The SSH port. Defaults to `22`. |
| **User name** | The account Yres signs in with. |
| **AuthenticationType** | `Basic` to sign in with a password, `SshPublicKey` to sign in with an SSH key. Your choice determines which fields appear next. |
| **Password** | Only with `Basic`: the password of the account. |
| **Private key (base64 encoded OpenSSH key)** | Only with `SshPublicKey`: the content of the private key file in OpenSSH format, base64 encoded. |
| **Passphrase** | Only with `SshPublicKey`, optional: the passphrase of the key. Leave it empty when the key has none. |

**Integration runtime:** if the SFTP server is reachable from the internet, the cloud runtime
`AutoResolveIntegrationRuntime` is enough. If the server sits in a shielded network, choose a **self-hosted
integration runtime** that can reach it. The chosen runtime is written into the linked service.

**Where the credentials go:** the web app stores no secrets. The password or key goes to the **Azure Key
Vault** of your own environment, under the name group `adf-{sourcename}-…`:

- with `Basic`: `adf-{sourcename}-password`;
- with `SshPublicKey`: `adf-{sourcename}-private-key-content` and `adf-{sourcename}-pass-phrase`.

The linked service refers to those secrets. Host, port and user name are stored in the linked service
itself.

## Preparation

1. Ask the administrator of the SFTP server for an account with **read access** to the folder(s) holding the files.
2. Choose how to sign in. If you use a key, make sure the **public key** is registered for the account on the
   server. Encode the **private key** with base64 before you paste it into the form.
3. Make sure the server is reachable from the chosen integration runtime (firewall, IP allowlist, port).

## Adding files

SFTP is a **file source**. There is no metadata refresh: after connecting you add files through the
dedicated file flow (**Used files**), just like with [File Server](https://yres.eu/en/wiki/integraties/bronnen/file-server). For each file you enter a
schema name and table name, the file location (ending in `/`), the file name and whether the first row
holds column names. For CSV files you then set the delimiters, for Excel files the sheet and optionally a
cell range.

**Load types:** in the file flow you choose **FULL**, **OVERWRITE** or **IMAGE**. With the
[delta window for file sources](https://yres.eu/en/wiki/concepten/load-types#the-delta-window-for-file-sources) you only
load files that changed within a look-back window.

## File formats

The data platform reads seven formats from an SFTP server: **CSV, Excel, Parquet, JSON, XML, ORC and
Avro**. In the web app you add files with the extension `.csv`, `.xlsx` or `.xls`.

> Official documentation: [Copy data from and to an SFTP server (Azure Data Factory)](https://learn.microsoft.com/en-us/azure/data-factory/connector-sftp)

---

**See also:** [Integration catalog](https://yres.eu/en/wiki/integraties/catalogus) · [All data source requirements](https://yres.eu/en/wiki/referentie/databron-vereisten) · [File Server](https://yres.eu/en/wiki/integraties/bronnen/file-server) · [Connect & load a data source](https://yres.eu/en/wiki/setup/databron-koppelen) · [Integrations — overview](https://yres.eu/en/wiki/integraties/overzicht)
