I am executing an azure-batch job, which creates a zip file as its output. The batch is being executed by an orchestrator with the responsibility of moving the output files to blob. I have this working, but it feels clunky - i.e. I download the file locally to the orchestrator then upload to blob:
CloudTask task; // executed task...
var node = task.GetNodeFile(fileName);
using (var stream = File.OpenWrite(localFile))
{
node.CopyToStream(stream);
}
var blobRef = _blobContainer.GetBlockBlobReference(blobFileName);
blobRef.UploadFromFile(localFile, FileMode.Open);
I tried passing the blob stream to the CopyToStream method directly, but nothing was moved to the blob:
node.CopyToStream(blobRef.OpenWrite());
Is it possible to copy the output file from a batch vm to blob without this extra hop?