in SamplesV1/ADFCustomActivityRunner/CustomActivityRunner/BlobUtilities.cs [43:66]
public string DownLoadLatestFile()
{
CloudBlockBlob latestBlob = GetLatestBlob();
if (latestBlob == null)
return null;
string filename;
// If the blob is embedded in a folder heirarchy find the name of the actual file
if(latestBlob.Name.Contains("/"))
filename = latestBlob.Name.Substring(latestBlob.Name.LastIndexOf('/')+1);
else
filename = latestBlob.Name;
string localFile = Path.Combine(GetTemporaryDirectory(), filename);
logger.Write($"Downloading latest blob file '{latestBlob.Name}' from blob folder '{folderPath}'");
latestBlob.DownloadToFile(localFile, FileMode.Create);
return localFile;
}