Azure 函数将文件发送到 sftp 服务器

Azure functions sending a file to sftp server

我遇到了用于连接 sftp 服务器的 https://github.com/sshnet/SSH.NET 库,但是它说它只与 .net 框架兼容,而我们使用 .net 核心编写 azure 函数。有谁知道任何其他方式?另外,连接到服务器后如何将文件发送到服务器。

已成功使用 Renci.SshNet Azure Functions。

上传非常简单:

var connectionInfo = new ConnectionInfo(
      config["SftpHostname"], 
      username, 
      new PasswordAuthenticationMethod(username, config["SftpPassword"]
    ));
sftpClient = new SftpClient(connectionInfo);
sftpClient.Connect();
sftpClient.UploadFile(requestFile, filePath);