How to manually create a directory on your Azure App Service

There are 3 kinds of files that an Azure App Service can deal with:

  • Persisted Files
  • Temporary Files
  • Machine Level read-only files

What does those mean and what can they be used for?

Persisted Files

These files are rooted in the D:\home path.  The contents of these files are shared between all the multiple instances of your App Services.  Information about the file structure under the D:\home directory can be found here which is replicated in Figure 1.

image

Figure 1, directory structure of the persisted files of an Azure App Service

Notice the:

NOTE: the files stored in the D:\home are accessible from all instances of your App Service Plan, which I describe here.  If the ASP is running in Standard mode, you can have up to 10 instances, 20 in Premium mode, for example, all of which would read/write to the same shared location.

To create a directory using a tool like FIleZilla, right-click on the folder you want to put the new folder into, and select Create Directory, as seen in Figure 2.

image

Figure 2, how to create a directory, folder on an Azure App Service

Temporary Files

These files, stored in the D:\Local are accessible only from the individual instance of the App Service Plan.  You can look over the file system structure using KUDU/SCM which I describe here.  You can see the partial structure in Figure 3.

image

Figure 2, the temporary file structure of an Azure App Service, how to create a directory, folder on an Azure App Service

Also notice that you can create a new folder or new file.  I would recommend you navigate to the D:\Local\Temp directory to create it, just to keep things cleaner.

NOTE: if you scale down or an auto heal happens, described here, and the VM running the app is removed from service, the contents in this location will be gone as well.  Only write things into this location which are actually temporary.  If you are running only on single instance, than it is a little more simplified.

Machine Level read-only files

The Azure App Service is able to access standard Windows locations like %ProgramFiles% and %windir% but can never be modified.  Some more information about this topic can be found here.