无法从VSTS连续集中将服务结构应用程序部署到azure远程集群

时间:2016-04-09 16:36:55

标签: azure visual-studio-2012 azure-devops azure-service-fabric azure-pipelines-build-task

根据此文档,我已在Visual Studio Team Services中为Service Fabric应用程序配置了CI构建:https://azure.microsoft.com/en-us/documentation/articles/service-fabric-set-up-continuous-integration

但是我已经更改了上面文档中指定的部署部分。因为我想部署在我之前创建的远程azure集群上,所以我打电话给 使用power shell使用所需参数部署FabricApplication.ps1。但不幸的是,这不起作用。我收到以下错误:

[void](Connect-ServiceFabricCluster @ClusterConnectionParameters) InvalidOperation :( :) [Connect-ServiceFabricCluster],FabricException FullyQualifiedErrorId:CreateClusterConnectionErrorId,Microsoft.ServiceFabric.Powershell.ConnectCluster

警告:无法验证与Service Fabric群集的连接。

[error] Test-ServiceFabricClusterConnection:群集连接实例为空 [错误]在C:\ Program Files \ Microsoft SDKs \ Service [error] Fabric \ Tools \ PSModule \ ServiceFabricSDK \ Publish-NewServiceFabricApplication.ps1:119 char:16 空虚 :ResourceUnavailable:(:) [Test-ServiceFabricClusterConnection],NullReferenceException FullyQualifiedErrorId:GetClusterConnectionErrorId,Microsoft.ServiceFabric.Powershell.TestClusterConnection

我可以使用visual studio成功部署。即使我使用power shell从构建机器运行Deploy-FabricApplication.ps1,也可以部署应用程序而不会出现任何错误。但是,只有当我使用VSTS构建步骤(CI的一部分)运行它时,才会出现上述错误。

请注意,根据Charisk在另一个stackoverflow线程上的建议,我修改了Deploy-FabricApplication.ps1文件,将第169行放在下面一行。 $ global:clusterConnection = $ clusterConnection

这也没有帮助。提前感谢您的帮助。

2 个答案:

答案 0 :(得分:2)

在您的发布配置文件http://s30.postimg.org/bttleqitd/cloud.jpg中,您使用了StoreLocation="CurrentUser",但是如果您遵循https://azure.microsoft.com/en-us/documentation/articles/service-fabric-set-up-continuous-integration,特别是导入您的自动化证书部分设置您的构建计算机然后您可能已将证书导入LocalMachine商店位置。

只需将发布配置文件中的StoreLocationCurrentUser更改为LocalMachine,您就应该好了。

答案 1 :(得分:0)

点源符号表示调用脚本。 " xxx.ps1&#34 ;.有关详细信息,请参阅此链接:https://github.com/bradjasper/django-jsonfield

PowerShell – What is dot sourcing and why use it?