0

The web app already running on .NET Core 3.1 LTS with IIS (windows server 2019)

Recently, I deployed as an Azure Web App Service but I encountered a file write error.

The application trying to create a new file for some business requirement.

Error message; System.IO.IOException: Read-only file system

Has anyone encountered this problem on Azure Linux Web App?

Solved: The Azure Linux Web App Service doesn't support directly file uploading to a regular folder under the wwwRoot. If you can running on the linux web app service, you need to use blob / storage etc..

Hotkey
  • 103
  • 7
  • Please read [How do I ask a good question?](https://stackoverflow.com/help/how-to-ask) as well as [How to create a Minimal, Reproducible Example](https://stackoverflow.com/help/minimal-reproducible-example) - what is the path of your file? How are you exactly constructing it? – Ermiya Eskandary Oct 12 '21 at 15:00
  • Azure Linux Web App? windows server 2019 ? Which OS you use when create the webapp? – Jason Pan Oct 13 '21 at 06:55

2 Answers2

1

Azure web app recommends that the wwwroot folder has read and write permissions. Whether it's Linux or Windows, it's the same.

In addition, it is not recommended to put the content of file operations in the project directory. For example, excel files generated under a certain business or uploaded image files in the deployment file. And the files are recommended to be stored in azure storage.

Jason Pan
  • 15,263
  • 1
  • 14
  • 29
0

From the information which you have provided we can understand that there is any issue in creating a file in a specific directory where you don’t have access to it.

Refer to this SO thread where we got the insights to disable read-only mode, thanks to MarkXA.

Make sure that you have provided correct path whether it is any storage account or local storage where you are getting files. Also, if possible, elaborate your questions with full error trace, path you are using to access.

SaiKarri-MT
  • 1,174
  • 1
  • 3
  • 8