asp.net core configuration json file with reloadOnChange and azure files?

7/2/2018

are file/directory change events supported if one uses Azure Files as a volume mounted in an AKS cluster as described as here aks documentation?

I would like to mount a volume that contains a configuration file and use asp.net core's automatically reloadOnChange feature.

var config = new ConfigurationBuilder()
    .SetBasePath(azureFileStoreDirectory)
    .AddJsonFile("appsettings.json", optional: false, reloadOnChange: true)
    .Build();

thanks!

-- xartal
asp.net-core
azure-files
azure-kubernetes

1 Answer

7/4/2018

As Chriss Pratt had suggested in his comment, I tried it on good luck.

Unfortunately, it doesn't work. That's what I found out:

If the App runs in Windows and Azure Files is mounted as Y:\MyShare, everything works here. If I change the file on a remote PC, the configuration is reloaded.

On the otherhand if the App runs on Linux in Docker under Kubernetes and Azure Files is mounted as volume via azureFile, the configuration is only reloaded if the file is changed within the container. If the file or folder is changed from a remote machine, the change is immediately visible in the container after an 'ls' or 'more myFile'. However, the configuration is not reloaded.

-- xartal
Source: StackOverflow