Ejemplo n.º 1
0
        public List <Task <bool> > ExecuteAsync()
        {
            ParseConnectionString();
            if (Log.HasLoggedErrors)
            {
                return(null);
            }
            List <Task <bool> > downloadTasks = new List <Task <bool> >();

            foreach (var blobFile in BlobNames)
            {
                string localBlobFile = Path.Combine(DownloadDirectory, Path.GetFileName(blobFile.ItemSpec));
                Log.LogMessage($"Downloading {blobFile} to {localBlobFile}");

                downloadTasks.Add(DownloadBlobFromAzure.ExecuteAsync(AccountName, AccountKey, ConnectionString, ContainerName, blobFile.ItemSpec, DownloadDirectory, BuildEngine, HostObject));
            }
            return(downloadTasks);
        }
Ejemplo n.º 2
0
        public static Task <bool> ExecuteAsync(string accountName,
                                               string accountKey,
                                               string connectionString,
                                               string containerName,
                                               string blobName,
                                               string downloadDirectory,
                                               IBuildEngine buildengine,
                                               ITaskHost taskHost)
        {
            DownloadBlobFromAzure downloadBlobFromAzure = new DownloadBlobFromAzure()
            {
                AccountName       = accountName,
                AccountKey        = accountKey,
                ContainerName     = containerName,
                BlobName          = blobName,
                DownloadDirectory = downloadDirectory,
                BuildEngine       = buildengine,
                HostObject        = taskHost
            };

            return(downloadBlobFromAzure.ExecuteAsync());
        }