我偶然发现用于连接sftp服务器的https://github.com/sshnet/SSH.NET库,但是它说它只与.net框架兼容,而我们使用.net核心来编写azure函数。有没有人知道其他方法?另外,一旦我连接到服务器,我如何将文件发送到服务器。
发布于 2021-10-15 22:51:05
已经成功地将Renci.SshNet与Azure函数一起使用。
上传很简单,如下所示:
var connectionInfo = new ConnectionInfo(
config["SftpHostname"],
username,
new PasswordAuthenticationMethod(username, config["SftpPassword"]
));
sftpClient = new SftpClient(connectionInfo);
sftpClient.Connect();
sftpClient.UploadFile(requestFile, filePath);
https://stackoverflow.com/questions/69588969
复制相似问题