Azure Webjob - Local File System Access

I have an obsolete exe that takes the path to the local machine file, processes it and again displays the output file in the local path. Could this work on Azure Webjob?

I was thinking of writing an exe wrapper that downloads a file from the blob repository → stores it in the local file system → calls the obsolete exe with the local file path → gets the result and loads it again into blob.

Will this approach work or are there limitations?

+5
source share
2 answers

Such an exe should work fine, until you can transfer folders for recording from / to it. Before I get into WebJobs, I suggest checking it manually in a web application using the Kudu Console to make sure it is working fine.

Then, if your goal is for it to work with blob I / O, exe exe should work. Obviously, it would be cleaner to have it work directly with blog streams, but if the deprecated exe is given and cannot be changed, the wrapper approach should be good.

+3
source

If you end up writing a wrapper, then you might be interested in the file binding extension for the WebJobs SDK: https://github.com/Azure/azure-webjobs-sdk-extensions . For instance:

// When new files arrive in the "import" directory, they // are uploaded to a blob container then deleted. public static void ImportFile( [FileTrigger(@"import\{name}", "*.dat", autoDelete: true)] Stream file, [Blob(@"processed/{name}")] CloudBlockBlob output, string name, TextWriter log) { output.UploadFromStream(file); file.Close(); log.WriteLine(string.Format("Processed input file '{0}'!", name)); } 
+4
source

Source: https://habr.com/ru/post/1232935/


All Articles