使用Azure DevOps任务"Azure App Service Deploy"将其部署到Azure Web App Web根目录中. v3 [英] Deploying into Azure Web App web root with Azure DevOps task "Azure App Service Deploy" v3
问题描述
我正在将Azure DevOps与"Azure App Service Deploy"任务(AzureRmWebAppDeployment @ 3)一起使用,以部署到Azure网站,但在部署到Web根目录时遇到了麻烦.
I'm using Azure DevOps with the "Azure App Service Deploy" task (AzureRmWebAppDeployment@3) to deploy to an Azure Web Site and am having trouble deploying to the web root.
该应用程序是PHP,具有一个公共"文件夹,该文件夹被设计为唯一公开公开的文件夹.文件夹结构如下:
The application is PHP and has a "public" folder which is designed to be the only folder to be exposed publicly. The folder structure is like this:
/
application/
vendor/
public/
index.php
favicon.ico
images/
etc...
当我将虚拟应用程序"设置设置为"(如空白)配置Azure App Service Deploy任务时,它实际上似乎默认为"/"虚拟应用程序.
When I configure Azure App Service Deploy task with the "Virtual application" setting to "" (as in blank), it actually appears to default to the "/" virtual application.
这是有问题的,因为默认应用程序("/")应该指向/sites/wwwroot/public/
,以使索引文件位于/sites/wwwroot/public/index.php
.
This is problematic as the default application ("/") should be pointing to /sites/wwwroot/public/
such that the index file is at /sites/wwwroot/public/index.php
.
此设置中发生的是,当虚拟应用程序"设置为空时,部署任务默认显示为"/",这导致部署到/sites/wwwroot/public
,因此我的索引文件位于/sites/www/root/public/public/index.php
(可以在Web上的 https://app.azurewebsites.net/public/index上进行访问. php )
What happens in this setup is that the deploy task appears to default to "/" when the "Virtual application" setting is left blank, which results in deploying to /sites/wwwroot/public
so that my index file is at /sites/www/root/public/public/index.php
(which would be accessible on the web at https://app.azurewebsites.net/public/index.php)
如何将应用程序部署到Web根目录/sites/wwwroot/
,以使索引文件位于磁盘上的/sites/wwwroot/public/index.php
?
How can I deploy the application to the web root /sites/wwwroot/
such that my index file is located at /sites/wwwroot/public/index.php
on disk?
Azure DevOps
应用服务
推荐答案
我知道这是一个较晚的答复..但是我找到了解决方案.在您的Webapp中,配置一个虚拟应用程序,并将其指向site \ wwwroot,然后在为Azure App Service Deploy配置任务时在Azure管道中,在其中设置虚拟应用程序.我已经测试过并且可以正常工作.
I know this is a late reply.. but i found a solution for this. In your Webapp, configure a virtual application and point it to site\wwwroot and then in the azure pipeline when you configure the task for Azure App Service Deploy, set the virtual application in there. I have tested and it works.
J
这篇关于使用Azure DevOps任务"Azure App Service Deploy"将其部署到Azure Web App Web根目录中. v3的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!