Search code examples
c#azurewwwroot

How to use "wwwroot" folder in azure that's already working in IIS


I want to deploy my C# API project in Microsoft Azure.

I've changed my wwwroot folder name to "Documents" like:

public static void Main(string[] args)
{
    var host = new WebHostBuilder()
        .UseKestrel()
        .UseWebRoot("Documents")
        .UseContentRoot(Directory.GetCurrentDirectory())
        .UseIISIntegration()
        .UseStartup<MyStartup>()
        .Build();

    host.Run();
}

It is working perfectly using POSTMAN or local server but when I'm accessing it with Microsoft Azure, It is showing error of not finding the above mentioned folder. How can I get it in Azure?


Solution

  • In Azure you have to go to Application setting and edit the path according to your requirements. Picture is attached for guidance.