This module contains SFTP to Azure Blob Storage operator.

Module Contents



Transfer files to Azure Blob Storage from SFTP server.



SftpFile = '*'[source][source]
class*, sftp_source_path, container_name, blob_prefix='', sftp_conn_id='sftp_default', wasb_conn_id='wasb_default', load_options=None, move_object=False, wasb_overwrite_object=False, create_container=False, **kwargs)[source]

Bases: airflow.models.BaseOperator

Transfer files to Azure Blob Storage from SFTP server.

See also

For more information on how to use this operator, take a look at the guide: Transfer Data from SFTP Source Path to Blob Storage

  • sftp_source_path (str) – The sftp remote path. This is the specified file path for downloading the single file or multiple files from the SFTP server. You can use only one wildcard within your path. The wildcard can appear inside the path or at the end of the path.

  • container_name (str) – Name of the container.

  • blob_prefix (str) – Prefix to name a blob.

  • sftp_conn_id (str) – The sftp connection id. The name or identifier for establishing a connection to the SFTP server.

  • wasb_conn_id (str) – Reference to the wasb connection.

  • load_options (dict | None) – Optional keyword arguments that WasbHook.load_file() takes.

  • move_object (bool) – When move object is True, the object is moved instead of copied to the new location. This is the equivalent of a mv command as opposed to a cp command.

  • wasb_overwrite_object (bool) – Whether the blob to be uploaded should overwrite the current data. When wasb_overwrite_object is True, it will overwrite the existing data. If set to False, the operation might fail with ResourceExistsError in case a blob object already exists.

  • create_container (bool) – Attempt to create the target container prior to uploading the blob. This is useful if the target container may not exist yet. Defaults to False.

property source_path_contains_wildcard: bool[source]

Checks if the SFTP source path contains a wildcard.

template_fields: Sequence[str] = ('sftp_source_path', 'container_name', 'blob_prefix')[source]

Perform dry run for the operator - just render template fields.


Upload a file from SFTP to Azure Blob Storage.


Get SFTP files from the source path, it may use a WILDCARD to this end.


Extract from source path the tree behavior to interact with the remote folder.


Check if there are multiple wildcards used in the SFTP source path.


Property of sftp hook to be reused.


Get a blob name based on the previous name and a blob_prefix variable.


Upload a list of files from sftp_files to Azure Blob Storage with a new Blob Name.


Delete files at SFTP which have been moved to Azure Blob Storage.

Was this entry helpful?