0
Azureストレージにxml(たとえば)を作成し、そのファイルをSFTPサーバーに直接アップロードしたいとします。ファイルをAzure Storage BlobからSFTPに転送するときに問題が発生する
string name = DateTime.Now.ToString("yyyyMMddhhmmss") + ".xml";
// Retrieve storage account from connection string.
CloudStorageAccount storageAccount = CloudStorageAccount.Parse(CloudConfigurationManager.GetSetting("StorageConnectionString"));
// Create the blob client.
CloudBlobClient blobClient = storageAccount.CreateCloudBlobClient();
// Retrieve a reference to a container.
CloudBlobContainer container = blobClient.GetContainerReference("xxxxxxxxxxxx");
// Create the container if it doesn't already exist.
container.CreateIfNotExists();
//Create reference to a Blob that May or Maynot exist under the container
CloudBlockBlob blockBlob = container.GetBlockBlobReference(name);
// Create or overwrite the "something.xml" blob with contents from a string
string xml = "some xml";
blockBlob.UploadTextAsync(xml);
//Upload file to the sftp server
string fpath = "https://someazureserver.blob.core.windows.net/xxxxxxxxx/" + name;
sftp.Connect();
try
{
string INVENTORY = "xxxx/xxxx/xxxx"; //the file path in sftp
sftp.Put(fpath, INVENTORY);
}
finally { sftp.Close(); }
私はそのブロブのURLへのファイルパスを記入しようとしましたが、それは動作しませんでした。私はオンラインで検索しましたが、BLOBファイルのパスについては何も見つかりませんでした。 azureからsftpにファイルを転送する別の方法はありますか? ありがとうございました!
がえーえ、私はちょうどマイクロソフトQAを確認し、彼らは私にとってとてもGGまだこの機能を持っていけません。私はそれを行う別の方法を見つける必要があるように見えます。とにかくありがとう!!私はあなたの答えを使用するつもりです。 –