Ejemplo n.º 1
0
        public async Task Run([TimerTrigger("0 */2 * * * *")] TimerInfo myTimer, ILogger log)
        {
            var blobNames = await BlobStorageService.GetFileNamesInContainer(Constants.ImageContainer);

            foreach (var blobName in blobNames)
            {
                log.LogDebug($"Processing blob {blobName}");
                var blobStream = await BlobStorageService.GetBlobAsStream(Constants.ImageContainer, blobName);

                var rotateRight = ImageService.RotateClockwise(blobStream);
                await BlobStorageService.UploadStreamToBlob(Constants.ClockwiseImageContainer, blobName, rotateRight);

                blobStream.Position = 0;
                var rotateLeft = ImageService.RotateAntiClockwise(blobStream);
                await BlobStorageService.UploadStreamToBlob(Constants.AntiClockwiseImageContainer, blobName, rotateLeft);

                log.LogDebug($"Done processing blob {blobName}");
            }
        }