简体   繁体   中英

create custom directory in Azure batch

I'm uploading a file from blob storage to an Azure Task which gets uploaded to the task VM's wd directory. I can access the file fine from the executing task. I upload the file with:

var filename = "myFile.txt";
ResourceFile myResource = new ResourceFile(blobURL,
                  fileName);


 List<ResourceFile> taskFiles = new List<ResourceFile>();
 taskFiles.Add(myResource);

 task.ResourceFiles = taskFiles;
 job.AddTask(task);

My question is, I'd like to specify a directory for the file at the point of setting the task up. (So to have the file located in wd\\MyDirectory\\myFile.txt") Does anyone know if this is possible, and if so how?

Specifying the directory as part of the filename works (I had previously thought not) - so in the end I have:

var filename = @"MyDirectory\myFile.txt";
ResourceFile myResource = new ResourceFile(blobURL,
                  fileName);

and myFile.txt is placed within the wd\\MyDirectory directory on the target vm.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM