question

JasonZwanepoel-5675 avatar image
JasonZwanepoel-5675 asked ·

Devops Webapp Deployment to wwwroot not wwwroot\public ?

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-webapps
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

ajkuma-MSFT avatar image
ajkuma-MSFT answered ·

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.



Share
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.