Connect to an SFTP server
Connect an SFTP server, confirm its identity, read its files with Balto, and load them into your warehouse with an extract pipeline.
This page explains how to connect an SFTP server to a Project and use its files. Vendors and Partners often deliver data as files on an SFTP server. Balto can list and read those files where they are. An extract pipeline can load them into your warehouse on a schedule. For the steps that every provider shares, see Create and manage connections.
An SFTP connection is a read-only source. Bobsled AI doesn't write, rename, or delete files on the server.
Before you begin
Make sure that you have the role that creates connections. Then get the following details from the server's owner:
Store the sign-in credentials in the following secrets that the Project uses:
- For password sign-in, one secret for the password.
- For key sign-in, one secret for the whole private key, including its
BEGINandENDlines. - If the private key has a passphrase, a second secret for the passphrase.
Bobsled AI accepts the following private key formats:
- OpenSSH keys
- Traditional PEM keys (
BEGIN RSA PRIVATE KEYorBEGIN EC PRIVATE KEY) - PuTTY version 2 keys
To convert a PKCS#8 key (BEGIN PRIVATE KEY), run the following command:
ssh-keygen -p -f KEY_FILEReplace the following:
KEY_FILE: the path to your private key file.
To convert a PuTTY version 3 key, export it from PuTTYgen with Conversions > Export OpenSSH key.
Required server access
Ask the server's owner to confirm the following:
- The server has a public IPv4 address. Bobsled AI connects only to servers on the public internet, and it doesn't use IPv6.
- The server offers SFTP to the user. Bobsled AI doesn't support FTP or FTPS.
- The server accepts password or key sign-in. Bobsled AI doesn't support keyboard-interactive sign-in.
- The server offers current SSH algorithms. Servers that offer only older algorithms fail the test.
- The user can list and read the folder.
- The server accepts the client address. For more information, see IP allowlists.
The saved folder isn't a security boundary. The server owner can confine the SFTP user to its folder on the server, for example with a chroot. Ask for this confinement if people that you don't trust can upload files or create links on the server.
Create an SFTP connection
To create an SFTP connection, do the following:
- On the Connections page, click Add connection, and then select SFTP.
- Enter a Display name, such as
Vendor SFTP. - In Host, paste the server address, such as
sftp://acme@sftp.vendor.example:2222/outbound. Bobsled AI fills Host, Port, Username, and Folder (optional). It ignores a password in the address. You can also enter the values instead of pasting an address. - Check each value.
- Click Check server. Bobsled AI reads the server's host key without signing in.
- Compare the key with the owner's fingerprint. For more information, see Confirm the server's identity.
- Click Trust this server.
- In Login method, select Password or Private key.
- Select the secrets that hold the sign-in credentials.
- Click Save connection. Bobsled AI tests the connection. The test signs in, opens the folder, and reads its first entries to confirm that the user can list it. To test again later, click Test connection in the connection's row.
To read from the folder that the server opens after sign-in (the login folder), leave Folder (optional) empty. Bobsled AI reads only inside the saved folder and skips links that point outside it.
Confirm the server's identity
Check server shows the Key type, Server software, SHA256 fingerprint, and MD5 fingerprint.
To compare fingerprints, paste the owner's fingerprint into Fingerprint from the server's owner (optional). Bobsled AI then shows Fingerprints match or Fingerprints do not match. Both of the following forms work, with or without their SHA256: or MD5: labels:
- SHA256, with or without the trailing
= - MD5, with or without colons
If the fingerprints don't match, Trust this server is unavailable. A server usually has one host key for each key type, such as ssh-ed25519 and ssh-rsa, and presents only one of them to Bobsled AI. If the owner sent the fingerprint of another key type, it doesn't match. Ask the owner for the fingerprint of the key type that Key type shows.
If the owner can't give you a fingerprint, you can trust the key that Bobsled AI shows. Bobsled AI then detects any later change to that key.
How Bobsled AI pins host keys
Bobsled AI pins the key's type and its SHA256 fingerprint together. Connection tests, browsing, file reads, and pipeline runs ask the server only for pinned key types. They keep working if the server later adds a host key of another type.
Bobsled AI supports the following host key types: ssh-ed25519, ecdsa-sha2-nistp256, ecdsa-sha2-nistp384, ecdsa-sha2-nistp521, and ssh-rsa.
Accept a changed host key
If the server presents an unpinned key, or stops offering the pinned key type, every test, browse, file read, and pipeline run stops. The error says that the identity of the server changed, or that the server no longer offers the trusted key type.
A changed key can mean that the owner replaced the key or moved the server. It can also mean that another server answered.
To accept a new key, do the following:
- Confirm the change with the server's owner.
- Open the connection, and then click Edit.
- Click Check server again.
- Compare the new fingerprint with the owner's fingerprint.
- Click Trust this server.
- Click Save changes.
Plan a key rotation
A connection can pin up to 4 host keys. If the owner announces a new host key before the switch, pin it next to the current key. The connection then keeps working through the change, because tests, browsing, Balto's file reads, and pipeline runs accept every pinned key.
To pin a new key, add the new key's type and fingerprint to hostKeys with the connections API. After the switch, remove the old key.
Browse the files
To browse the files, do the following:
- In the connection's row, open More actions, and then select Browse assets.
- Open a folder to see its files, sizes, and modified times. Bobsled AI lists folders first, and then files.
Browsing shows one folder at a time. A folder with more than 10,000 entries can't be browsed. Choose a subfolder.
Read files with Balto
Ask Balto to list the files on the connection and to read one. For example:
List the files in outbound/sales on Vendor SFTP and summarize the newest one.
Balto reads the same file formats as for Amazon S3 and Google Cloud Storage, up to 10 MiB for each file. Parquet files are the exception. Balto previews them up to 64 MiB.
Bobsled AI checks the file's size and modified time before and after each read. If either one changes, the file is probably still uploading. Wait, and then ask Balto to read it again.
When Balto lists files, it doesn't open folders that are links to other folders. To read files in a linked folder, give Balto that folder's path.
Query files with SQL
Balto can run SQL over CSV, JSON, Parquet, and Excel files on the connection, and join them with warehouse tables. An SFTP connection allows 2 file query downloads at the same time and 2 GiB in one query. This limit doesn't cover browsing, Balto's file reads, or pipeline runs. For formats, limits, and how Bobsled AI detects changed files, see Query files with SQL.
Load files with a pipeline
An extract pipeline loads a folder, one file, or the files that match a pattern into a warehouse table. Ask Balto to build the pipeline. For example:
Load the CSV files in outbound/sales on Vendor SFTP into the warehouse every four hours. Load only new files.
Balto reads a sample file, sets the format options, and adds the Blueprint files to a Draft. Review the Draft, validate it, save it, and publish it.
Blueprint files
A pipeline needs three Blueprint files. The examples in this section load the CSV files in outbound/sales/.
The integration file binds the pipeline source to the saved connection:
spec_version: "2"
type: integration
name: vendor_drop
dogsled_connection_ref: vendor-sftp
dogsled_source_kind: sftpSet dogsled_connection_ref to the connection's slug. Bobsled AI makes the slug from the Display name: lowercase letters and numbers, with hyphens between words. For example, Vendor SFTP becomes vendor-sftp.
The Resource file describes one folder of files:
spec_version: "1"
type: resource
name: daily_sales
integration: vendor_drop
description: Daily sales files from the vendor.
source:
path: "outbound/sales/"
format: csv
compression: none
options:
header: true
include_filename: true
include_file_metadata: true
replication:
method: incremental_append
cursor:
field: last_modified
tie_breaker: path
schema_contract: evolve
output:
order_id:
type: string
sold_at:
type: timestamp
amount:
type: numberThe pipeline configuration schedules the extract:
type: pipeline_config
destinations:
warehouse:
type: dogsled_managed
dogsled_connection_ref: warehouse-prod
pipelines:
vendor_daily:
type: extract
source: vendor_drop
destination: warehouse
runner: managed
schedule: every 4h
resources:
- resource: daily_salesReplace the following:
warehouse-prod: the slug of your warehouse connection.
Resource paths
Write source.path relative to the connection's folder. If the connection has no folder, write it relative to the login folder. Use one of the following forms:
**/ also matches no folder, so outbound/**/*.csv includes the CSV files directly in outbound/. Validation rejects . and .. segments, backslashes, and paths that start with /. If a path doesn't exist on the server, the run fails.
Give each Resource files in one format: CSV, JSONL, or Parquet. For gzip files, set compression: gzip. When a Resource path is a folder, keep other files out of it. A text file in another format can still load as rows.
If Bobsled AI can't read one file, it skips that file and adds a warning to the run log. If the connection drops or the server stops responding for 60 seconds, the run fails. It doesn't skip the remaining files. Pipelines skip links and special files.
Replication
Choose the replication method that matches how the vendor writes files:
incremental_append: Use this method with thelast_modifiedcursor when the vendor adds new files and never changes old ones. Each run loads only files that are newer than the last successful run and appends their rows to the table. If a file changes, the next run reads it again in full and appends its rows again.full_refresh: Use this method when the vendor replaces files in place. Each run reloads every file in the folder.
IP allowlists
Some servers accept connections only from listed client IP addresses. To discuss network access for such a server, contact Bobsled AI support.
Fix a failed test
The test result names the cause. The following table lists each result and the action to take:
Limitations
SFTP connections have the following limitations:
- Pipelines skip links and special files.
- Balto reads files up to 10 MiB. Parquet previews go up to 64 MiB.
- Browsing shows folders with up to 10,000 entries.
- File queries read up to 2 GiB in one query, with 2 downloads at the same time on one connection.
For the protocols, sign-in methods, and network addresses that Bobsled AI supports, see Required server access.
What's next
- To read a server's host key before you create a connection, use the SFTP host key check in the API. Create and test SFTP connections with the same connection endpoints as other providers.
- To configure an SFTP source in a pipeline, see Read from an SFTP server.
- To inspect pipeline runs and schedules, see Run and monitor pipelines.
