0
votes

I need to download lot of files from blob storage and zip/compress those files. Since the files size is large (> 2GB), Here is what I am doing.

  • Create a dir at %APPDTA%\mytmp.
  • Download files from the blob storage to above dir.
  • Execute Powershell.exe -executionpolicy remotesigned Compress-Archive -Path srcDir -DestinationPath %APPDTA%\mytmp\myZip.zip
  • All of the above commands were successful and no errors. But myZip.zip is missing and java code is throwing java.nio.file.NoSuchFileException: D:\local\AppData\mytmp\myZip.zip

On local windows 10 box above code works fine.

I am not sure what is going on. Any help is appreciated.

Environment: Java 8, Tomcat, PoerShell version 1.4.0

1
Have you tried running that command from the console (kudu) to see if it works? And also, to see if your blob content downloaded successfully? - David Makogon

1 Answers

0
votes

As documented in the Azure App Service file system documentation as below, any file that stored in either %APPDATA% or %TMP% is not shared among site instances and also will be deleted if your web app is restarted due to any reason, e.g. app pool recycle or manual restart.

You should also take note of the App Service Plan SKU size as it will also have an impact to the total size you can actually store at the temp locations in the Azure Web App instance.

For Free, Shared and Consumption (Functions) sites, there is a 500MB limit for all these locations together (i.e. not per-folder). For Standard and Basic sites, the limit is very high (over 100GB).

Source: Understanding the Azure App Service file system

Temporary files

A number of common Windows locations are using temporary storage on the local machine. For instance

%APPDATA% points to something like D:\local\AppData. %TMP% goes to D:\local\Temp.

Unlike Persisted files, these files are not shared among site instances.

Also, you cannot rely on them staying there. For instance, if you restart a web app, you'll find that all of these folders get reset to their original state.