azure - Azure 函数将文件发送到 sftp 服务器
问题描述
我遇到了用于连接 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);
推荐阅读
- python - Librosa 情节澄清
- javascript - 无法导入@material-ui/core/styles/MuiThemeProvider
- c# - 为什么字符串方法(对象对象)可能与 Func 不匹配
- c - 是否在 NaCL 库中替换了 Curve25519?
- python-3.x - 输出未在外部文本文件中打印
- node.js - 如何使用 find() 函数从 MongoDB 调用数据?
- sql - 无法基于 JOINS 执行连接两个表
- c - 如何在输入长度未知的情况下读取以逗号分隔的数字?
- java - 当我按下返回导航按钮时活动重新启动
- git - git file getting deleted again and again