Azure-pipelines-tasks: cURL Upload Files task does not support SFTP

Created on 28 Sep 2018  路  3Comments  路  Source: microsoft/azure-pipelines-tasks

Environment

  • Server: Azure Pipelines
  • Account name: dokumate
  • Project name: DokuMate
  • Release Pipeline: Deploy DokuMate for Office
  • Agent: Hosted VS2017

Issue Description

I need to upload files via SFTP, so I tried the "cURL Upload Files" task, because the description says that it supports SFTP. However, as shown in the log below, "sftp" is not supported or disabled in libcurl.

I tried the the curl command in my git bash locally and it worked. This looked something like this:

curl -k -u user:password -T filename sftp://HOST.sftp.wpengine.com:2222/path/to/folder/

Task logs

2018-09-27T22:15:39.0132093Z ##[section]Starting: Upload Software Package with cURL
2018-09-27T22:15:39.0136553Z ==============================================================================
2018-09-27T22:15:39.0136704Z Task : cURL Upload Files
2018-09-27T22:15:39.0136823Z Description : Use cURL to upload files with FTP, FTPS, SFTP, HTTP, and more.
2018-09-27T22:15:39.0136954Z Version : 2.137.0
2018-09-27T22:15:39.0137231Z Author : Microsoft Corporation
2018-09-27T22:15:39.0137354Z Help : More Information
2018-09-27T22:15:39.0137630Z ==============================================================================
2018-09-27T22:15:40.0016499Z [command]"C:\Program Files\Git\mingw64\bin\curl.exe" -T {D:/a/r1/a/DokuMate-CI/drop/local/path/to/folder/DokuMateForOfficeSetup-2.8.3.exe} sftp://HOST.sftp.wpengine.com:2222/path/to/folder/ --stderr - -u user:*
2018-09-27T22:15:41.7133571Z curl: (1) Protocol "sftp" not supported or disabled in libcurl
2018-09-27T22:15:41.7137608Z curl: (1) Protocol "sftp" not supported or disabled in libcurl
2018-09-27T22:15:41.7274476Z ##[error]C:\Program Files\Git\mingw64\bin\curl.exe failed with return code: 1
2018-09-27T22:15:41.7286977Z ##[error]curl failed with error: C:\Program Files\Git\mingw64\bin\curl.exe failed with return code: 1
2018-09-27T22:15:41.7301147Z ##[section]Finishing: Upload Software Package with cURL

Expected Behavior

I would obviously expect the cURL Upload Files task to support SFTP as advertised.

CrossPlatform

Most helpful comment

@joshmgross Thanks. In the meantime, I created my own Node-based Azure DevOps extension with an SFTP upload task that, in my own tests, is much faster than cURL. This is based on the ssh2-sftp-client npm package, which in turn depends on ssh2.

All 3 comments

@ThomasBarnekow Unfortunately the version of cURL installed on the agents does not support SFTP, so the task description is incorrect. On the Windows agents, the latest version of git bash is used and that is packaged with a version of cURL that does not support SFTP.
The task uses whatever version of cURL is on the machine, so if you need SFTP support you can create a task/script to download whichever version of cURL that you need and then just set the PATH properly and the task will work.

Sorry for the misleading task description, it will be updated.

@joshmgross Thanks. In the meantime, I created my own Node-based Azure DevOps extension with an SFTP upload task that, in my own tests, is much faster than cURL. This is based on the ssh2-sftp-client npm package, which in turn depends on ssh2.

@ThomasBarnekow Glad you got this worked out and in a faster way than cURL. Closing this issue.

Was this page helpful?
0 / 5 - 0 ratings