Need to create two Directories for storing and processing pdf files, while deploying application in microsoft azure

JacqulineDevarani A 1 Reputation point
2021-04-15T14:53:22.99+00:00
     //creating pdfupload folder if it doesn't exists
        var cdirectory = System.IO.Directory.GetCurrentDirectory();
        string pdfuploadpath = Path.Combine(cdirectory, "pdfupload");
        Directory.CreateDirectory(pdfuploadpath);

       //creating finalpdfupload folder if it doesn't exists
        string finalpdfuploadpath = Path.Combine(cdirectory, "finalpdfupload");
        Directory.CreateDirectory(finalpdfuploadpath);

It was working fine in local, but after deploying application in azure, it was throwing error. "Cant create static folders"

Kindly help me in this.

Azure App Services
Azure App Services
A feature of Azure App Service used to create and deploy scalable, mission-critical web apps.
4,326 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
7,010 questions
{count} votes

1 answer

Sort by: Most helpful
  1. JayaC-MSFT 5,481 Reputation points
    2021-04-19T06:43:59.473+00:00

    Hello @JacqulineDevarani A , You can try to create a virtual directory with Azure App Service from the Azure portal. Go to the App Settings for your application. Click on the Configuration blade then click on the Path Mapping tab to add a virtual directory.
    Then you can try accessing it using the virtual path.

    88943-image.png

    No comments