Web应用程序上创建虚拟目录

Web应用程序上创建虚拟目录

本文介绍了在同一个Azure Web应用程序上创建虚拟目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个在Azure上运行的应用程序,我需要复制该应用程序,以便不同的用户可以访问例如site.com/s1和site.com/s2并将它们分开使用。该应用程序是相同的,数据库将更改。



我尝试为我的应用程序创建一个虚拟目录,但是每次都会遇到相同的错误:虚拟路径'/ s1'无效。



我尝试从FTP创建物理目录,但可以看到新目录,但是Azure无法将其识别为物理的。



我想拥有wwwroot / s1 wwwroot / s2并按照我之前的解释访问那些应用程序。



解决方案

请尝试在Azure门户上配置虚拟目录 site / test1 ,如下图所示





将WebApp推送到Azure时,需要在以下位置的站点名称和目标URL部分中包括虚拟目录路径。连接选项卡





此后,我们可以使用站点名称/ site1访问WebApp





我们还可以从Azure Kudu工具(


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.

解决方案

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

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

After that we can visit the WebApp with sitename/site1

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

这篇关于在同一个Azure Web应用程序上创建虚拟目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-06 00:45