Access to the path denied - Azure Function

Adrian 1 Reputation point
2022-07-13T16:02:04.183+00:00

Hi. I have Azure Function that write/read data to/from CSV file located in the root folder wwwroot. I got Access to the path <csvfilename>.csv is denied error. I tried to restart the app but still the same issue. Any idea how to resolve and prevent this?

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,909 questions
{count} votes

3 answers

Sort by: Most helpful
  1. MughundhanRaveendran-MSFT 12,506 Reputation points
    2022-07-14T06:12:44.587+00:00

    Hi @Adrian ,

    Please navigate to the Kudu site of the Function app and check if you are able to edit the .csv file. If you are able to edit it manually, then the function app should also have access to edit programmatically. Also check the path of the wwwroot folder, it is either C:\home\site\wwwroot or D:\home\site\wwwroot, you can verify in the command window

    220643-image.png

    Feel free to reach out to me if you have any queries or concerns.

    1 person found this answer helpful.

  2. Pierre-Luc Giguere 1,076 Reputation points
    2022-07-13T18:28:53.2+00:00

    Hi @Adrian

    Hope I can provide some help.

    I'm assuming Windows here.

    Make sure you are not running from a package:

    [...] When you run from a package, the wwwroot folder becomes read-only and you'll receive an error when writing files to this directory. [...]

    https://learn.microsoft.com/en-us/azure/azure-functions/run-functions-from-deployment-package#general-considerations

    Application setting WEBSITE_RUN_FROM_PACKAGE should not be set to 1.

    https://learn.microsoft.com/en-us/azure/azure-functions/functions-how-to-use-azure-function-app-settings?tabs=portal#settings

    Let me know if that helps.


  3. Adrian 1 Reputation point
    2022-07-20T14:54:24.377+00:00

    No issue since I reported last time. Not sure what happened but working now so far

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.