首页 > 解决方案 > 使用 az webapp deployment source 从 git 部署代码,但当应用位于 git 存储库子文件夹中时

问题描述

我正在尝试将代码从我的 gitlab CI 运行器部署到 Azure。我正在使用az webapp deployment来完成这项工作:

az webapp deployment source config --branch master --manual-integration --name [myWebApp] --repo-url [git url] --app-working-dir [folder] --resource-group [myResourceGroup]

但是有一个问题,默认工作目录是 git 的根文件夹。我的应用程序位于根目录的子文件夹中。我检查了命令配置,我再次看到了--app-working-dir哪个可以满足我的要求,但只有在--cd-project-url设置时才有效(我不需要而且我没有使用 VSTS)。此外,没有使用此配置的示例。我希望有一个类似于我通过 azure cloud shell 部署时使用的命令集:cd <app-folder>; az webapp up --sku B1 --name <app-name>. 有没有办法以更简单的形式进行部署?

标签: pythongitazurecontinuous-integrationgitlab

解决方案


在 git 存储库的根目录中创建一个 .deployment 文件。并在配置中添加项目子文件夹。届时它将起作用。

https://github.com/projectkudu/kudu/wiki/Customizing-deployments


推荐阅读