Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create virtual directory on same azure web app

I have an application running on Azure, what I need is to have the application copied so different users can access for example site.com/s1 and site.com/s2 and use them as separate. The application is the same, the database will change.

I tried to create a virtual directory for my app but I get the same error every time: "The physical path for virtual path '/s1' is invalid."

I tried creating a physical directory from FTP and I can see the new directory, but Azure don't recognize it as a physical one.

I would like to have wwwroot/s1 wwwroot/s2 and access those apps the way I explained before.

I'm creating the virtual directory from the management portal like you see in the image.

like image 997
fabian278 Avatar asked Mar 28 '17 15:03

fabian278


People also ask

How do you deploy a web app to a sub folder on Azure App Service?

Using Azure App Service Deploy When creating an Azure DevOps pipeline, you can add the Azure App Service deploy task to deploy to such a web app. The default yaml configuration of this deployment task looks more or less as follows. There is no option on the yaml task to designate a specific subfolder to deploy to.

How do I create a virtual directory?

Right-click the Web site that you want (for example, Default Web Site), point to New, and then click Virtual Directory. On the Welcome to the Virtual Directory Creation Wizard page, click Next. On the Virtual Directory Alias page, type the alias that you want (for example, Sales), and then click Next.

Can Azure App Service host multiple sites?

Yes, the setup is very much possible and is a common requirement. You can deploy multiple separate 'WebApps' under an 'App Service Plan'.


1 Answers

Please have a try to config the Virtual directory site/test1 on the Azure portal as following screenshot

enter image description here

When we push the WebApp to the Azure, we need to include the virtual directory path in the Site Name and Destination URL sections on the Connection tab

enter image description here

After that we can visit the WebApp with sitename/site1

enter image description here

We also can check the uploaded file from Azure Kudu tool (https://sitename.scm.azurewebsites.net/DebugConsole/?shell=powershell)

enter image description here

like image 157
Tom Sun - MSFT Avatar answered Sep 29 '22 02:09

Tom Sun - MSFT