简体   繁体   中英

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?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM