无论如何都要将发布配置文件直接导入.NET Core的Team Services Build Definition

时间:2017-06-08 07:38:20

标签: azure continuous-integration .net-core azure-devops ef-migrations

我有一个.NET Core应用程序,我已通过Azure部署向导配置了持续集成。

enter image description here

此过程在我的团队服务中创建了一个构建定义,我已将其配置为在签入源代码时构建和部署。

enter image description here

代码构建和部署成功但我无法通过迁移获取数据库更改作为CI的一部分执行。我已从Azure下载了Web应用程序的发布配置文件,并将其导入Visual Studio。然后,我可以编辑发布设置,以包括在发布时运行迁移,如下所示。

enter image description here

当我从Visual Studio手动运行它时,它会成功发布并执行迁移脚本。

所以我想知道有没有办法将这个经过编辑和工作的发布配置文件导入我的团队服务持续集成?

1 个答案:

答案 0 :(得分:1)

尝试使用带有/p:DeployOnBuild=true /p:PublishProfile="[your publish profile]"参数的Visual Studio Build步骤。

  1. 修改发布配置文件以添加Password和AllowUntrustedCertificate节点。 (参见:Publish an Azure Web Site from the Command Line
  2. 向Visual Studio Build任务添加/p:DeployOnBuild=true /p:PublishProfile="[your publish profile]"个参数。