I recently needed to deploy some files to a webserver over SFTP using Azure DevOps pipelines. Despite the name SFTP is not related to FTP or FTPS as its SSH-based, so the FtpUpload@2 task won’t work for us. What we’re actually looking for is the CopyFilesOverSSH task. Let’s see how to configure it properly.
First we need an SSH service connection:
Afterwards we create our Azure Pipline as YAML file. Be aware that if you want to clean your target folder before deploying the service user needs full SSH permissions, not just SFTP.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters