Devops Webapp Deployment to wwwroot not wwwroot\public ?

Jason Zwanepoel 66 Reputation points
2020-06-03T07:38:08.923+00:00

When deploying to Azure Webapp Windows through Azure Devops.

So the issue is this. I know making the Physical Path to 'site\wwwroot' and virtual path of '/' will deploy my code to my wwwroot folder however I need the path to go to 'wwwroot\public' so that my application will work. This is a Laravel Application

How can I set this so that when I do a Deployment it adds my code to wwwroot instead of wwwroot\public but still keep access to my application.

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
6,865 questions
0 comments No comments
{count} votes

Accepted answer
  1. ajkuma 22,401 Reputation points Microsoft Employee
    2020-06-07T21:06:26.5+00:00

    Welcome to Microsoft Q&A! Thanks for posting a good question.

    I noticed that you had posted a similar thread here, with active conversion, I had responded there.
    Apologies for the late response here.

    Yes. Setting the virtual application path for the app is required because the Laravel application lifecycle begins in the public directory instead of the application's root directory.
    Other PHP frameworks whose lifecycle start in the root directory can work without manual configuration of the virtual application path.

    By default, Azure App Service points the root virtual application path (/) to the root directory of the deployed application files (sites\wwwroot).
    If I have understood your scenario correctly/Based on your requirement, you could go into the ‘public’ folder, create a web.config with Rewrite rules.

    If you wish to access your app would be accessible at http://example-site.com/public, but you would really want to direct http://example-site.com to the public directory instead.
    You could set the default document( index.php) appropriately.

    -<action type=”Rewrite” url=”index.php” appendQueryString=”true” />

    Kindly let us know further, we would be more than happy to assist you.

    Also, please see Deploying inplace and without repository for additional details.

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful