asp.netazure-web-app-servicepaasazure-file-share

Map azure files path to Azure App Service and access with Path


I'm working on a project to move a dotnet application from Virtual Machine to App Service.

The code has been moved already using deployment center and the pages loads up. But in the backend there are alot of file transfers happening where the folder paths are like D:/AppRoot/FolderA etc.

I have created a storage account and mapped the exact folder structure there as it's in the VM. From App Service configuration I have mounted the Azure Files Share. So it's now /mounts/AppRoot which contains the folders.

Now is it possible for me to direct the application to use the mounted path by updating the folder paths in the web.config file from anything that has D:/AppRoot/ to /mounts/AppRoot ?

Any advice on this will be a great help.

Tried playing around with the syntaxes and path directories. Nothing worked.

I tried googling around, Checking alot of Forums but no one seems to have suggested a final solution for this.


Solution

  • Yes, you can update the folder paths in the web.config file to use the mounted path.

    For this, you need to replace the path D:/AppRoot/ with /mounts/AppRoot/ in the web.config file. And this allows the application to access the files from the mounted path.

    enter image description here

    enter image description here

    <appSettings>  
        <add key="FolderPath" value="/mounts/AppRoot/FolderA" />
      </appSettings>
    

    Now the application be able to access the files from the mounted path.

    For more information refer to Mount Azure file share on Windows and Configuring apps.