[英]Azure Service Fabric continuous integration fails in Visual Studio Team Services (was VSO)
I have tried to set up continuous integration to deploy my Azure Service Fabric cluster automatically on git push
events in Team Services. 我尝试设置持续集成,以便在Team Services中的git push
事件上自动部署我的Azure Service Fabric集群。 I followed the default template for a Team Services Build Definition and a Team Services Release Definition based on this guide: 我遵循了基于本指南的Team Services Build Definition和Team Services Release Definition的默认模板:
Set up continuous integration for a Service Fabric application by using Visual Studio Team Services 使用Visual Studio Team Services为Service Fabric应用程序设置持续集成
For the most part everything works for the first deployment. 在大多数情况下,一切都适用于第一次部署。 After that it throws the following error: 之后它会抛出以下错误:
An application with name 'fabric:/<APP>' already exists, its type is '<APP>Type' and version is '1.0.0.20160812.7'. You must first remove the existing application before a new application can be deployed or provide a new name for the application.
From that it appears as though it is trying to completely redeploy the service instead of just upgrading the service. 从那看起来好像它试图完全重新部署服务而不是仅仅升级服务。 I have searched through all of the settings and tried creating and recreating the tasks but have not been able to resolve. 我搜索了所有设置并尝试创建和重新创建任务但无法解决。
Has anyone encountered this before? 有没有人遇到过这个?
You need to add or update a publish profile to enable the upgrade mode and use that profile to deploy the Service Fabric after the first deployment is succeed. 您需要添加或更新发布配置文件以启用升级模式,并在第一次部署成功后使用该配置文件部署Service Fabric。
To do this quickly, you can right click on your project and select "Publish" from Visual Studio, check "Upgrade the Application" option and click "Configure Upgrade Settings" if needed, and then click “Save Profile" link and commit/push the changes. 要快速执行此操作,您可以右键单击项目并从Visual Studio中选择“发布”,选中“升级应用程序”选项,然后根据需要单击“配置升级设置”,然后单击“保存配置文件”链接并提交/推送变化。
Though there is an accepted answer, I would still like to add to this thread. 虽然有一个公认的答案,但我还是想加入这个帖子。 In the approach below we need to edit only the Azure Devops Task. 在下面的方法中,我们只需要编辑Azure Devops任务。 Hopefully this will be useful to others who may encounter the same issue: One simple workaround when you encounter this issue is to change the "Overwrite Behavior" under the Advanced Setting for the build task to "Always". 希望这对可能遇到相同问题的其他人有用:遇到此问题时,一个简单的解决方法是将构建任务的“高级设置”下的“覆盖行为”更改为“始终”。 However, care must also be exercised so that if there are services which may already be running - all of them do get upgraded via a rolling upgrade (see second image). 但是,还必须注意,如果有可能已经运行的服务 - 所有这些服务都会通过滚动升级进行升级(参见第二张图片)。
To ensure that rolling upgrade is applied to all the services, in addition to the above, also ensure that the upgrade settings are configured as below: 为确保将滚动升级应用于所有服务,除上述内容外,还要确保升级设置配置如下:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.