将 laravel 项目从 VSTS 发布到 Azure 到正确的文件夹

release laravel project from VSTS to Azure to the correct folder

我正在使用 Visual Studio Team Services 将我的 LARAVEL 项目发布到 Azure。 在 Azure 应用程序设置中,默认情况下它设置为虚拟目录: “/”作为“site\wwwroot” (1)

但是使用 Laravel 框架可以从“http://PATH\public”访问应用程序 当我将“/”设置为 "site\wwwroot\public" 时,我可以访问我的应用程序。

但是如果我做了一个新的发布,我必须在发布期间从路径设置(1)中删除"public"并在之后添加它。 如果我不这样做,新版本将发布在 "site\wwwroot\public\public"

我想自动化这个过程而不是每个版本,必须删除 "public" 并在

之后添加它

我还测试了 Azure powershell 任务,但它不工作。 有没有人作为解决方案分享一下?

参考以下步骤:

  1. 登录 azure > Select 你的应用服务 > 应用程序设置
  2. 在虚拟应用程序和目录中添加新的虚拟应用程序或目录(虚拟路径:/public;物理路径:site\wwwroot\public;勾选Application option
  3. 编辑您的 build/release 定义
  4. Select Azure App Service Deploy任务并在虚拟应用程序输入框中指定public(包或文件夹:{project runtime files path}

感谢您的回复。 我做到了,但不是这样的:

  1. 前往AZURE -> APPLICATION -> APPLICATION SETTINGS
  2. 我用虚拟路径设置了虚拟目录: /myApplicationsite\wwwroot& /site\wwwroot\public.
  3. 转到 VSTS,在发布选项上,在 Deploy Azure App Service 任务上
  4. 我将虚拟应用程序设置为 /myApplication,它运行良好!