0

I am working with some sensitive files (mostly images) in my WebJob. My WebJob downloads the files from Azure Blob (container 1), does some processing and uploads to Azure Blob (container 2).

Because these files are sensitive in nature, I want to be 100% sure that WebJob deletes them once the Job is completed running.

Can someone tell me what happens to files downloaded in WebJob?

My download code looks like this ...

        var stream = new MemoryStream();
        using (StorageService storage = CreateStorageClient())
        {
            var bucketname = "container1";
            var objectToDownload = storage.Objects.Get(bucketname, "files/img1.jpg").Execute();
            var downloader = new MediaDownloader(storage);
            downloader.Download(objectToDownload.MediaLink, stream);
        }

Here CreateStorageClient() is my utility method which creates a StorageService object.

Sunny Tambi
  • 2,393
  • 3
  • 23
  • 27
  • If you want to download, process, and then delete files, you can store them in the temp directory and then delete them from there. I believe files in the temp directory are kept there until IIS recycles and then they're wiped out. – lopezbertoni Jan 30 '18 at 13:40
  • @lopezbertoni, I have already mentioned I am dealing with Azure WebJobs not physical machines / IIS. – Sunny Tambi Jan 30 '18 at 13:52
  • 1
    Then yes, you do have access to the temp directory through Path.GetTempPath(). – lopezbertoni Jan 30 '18 at 13:58
  • Will give it a try tomorrow and update here. Thanks for your response @lopezbertoni. – Sunny Tambi Jan 30 '18 at 18:08

1 Answers1

0

Solved using @lopezbertoni comment.

Also found relevant question which also helped - Azure Webjob - accessing local file system

Sunny Tambi
  • 2,393
  • 3
  • 23
  • 27