예제 #1
0
        private static async Task <List <string> > GetThumbnails(string workingDir, ILogger log)
        {
            log.LogInformation($"GetThumbnails");
            var blobList = await BlobHelper.GetBlobList(log);

            return(await BlobHelper.DownloadBlobs(blobList, workingDir, log));
        }
예제 #2
0
        public async Task UploadRandomBlob()
        {
            //arrange

            string videoFile = config.GetValue <string>("videoFile");

            //act
            BlobHelper.CreateStorageConnection(config.GetValue <string>("rawStorageConnectionString"), config.GetValue <string>("rawContainerRef"));
            await BlobHelper.UploadSummary(videoFile, newVideoId, log);

            var getBlobList = await BlobHelper.GetBlobList(log);

            var res = getBlobList.Results.Where(x => ((CloudBlockBlob)x).Name == newVideoId).FirstOrDefault();

            // assert
            Assert.AreEqual(newVideoId, ((CloudBlockBlob)res).Name);
        }
예제 #3
0
 public static void Run([QueueTrigger("cleanup-queue", Connection = "")] string myQueueItem, TraceWriter log)
 {
     try
     {
         log.Info($"C# Queue trigger function processed: {myQueueItem}");
         var message = JsonConvert.DeserializeObject <DeleteMessage>(myQueueItem);
         if (!message.DeleteAll)
         {
             return;
         }
         var blobList = BlobHelper.GetBlobList(message.TargetContainer);
         foreach (var blob in blobList)
         {
             blob.DeleteIfExistsAsync();
         }
     }
     catch (Exception ex)
     {
         log.Error($"Error on clean up function exception message: {ex.Message}");
         throw;
     }
 }