我已根据此文档在 Visual Studio Team Services 中为 Service Fabric 应用程序配置了 CI 构建:https://azure.microsoft.com/en-us/documentation/articles/service-fabric-set-up-continuous-integration .
但是我更改了上面文档中指定的部署部分。由于我想部署在之前创建的远程 azure 集群上,因此我调用 使用 power shell 部署具有所需参数的 Deploy-FabricApplication.ps1。但不幸的是这不起作用。我收到以下错误:
[void](Connect-ServiceFabricCluster @ClusterConnectionParameters) InvalidOperation: (:) [Connect-ServiceFabricCluster],FabricException FullQualifiedErrorId:CreateClusterConnectionErrorId、Microsoft.ServiceFabric.Powershell.ConnectCluster
警告:无法验证与 Service Fabric 群集的连接。
[错误]Test-ServiceFabricClusterConnection:群集连接实例为空 [错误]位于 C:\Program Files\Microsoft SDKs\Service [错误]Fabric\Tools\PSModule\ServiceFabricSDK\Publish-NewServiceFabricApplication.ps1:119 字符:16 空白 : ResourceUnavailable: (:) [Test-ServiceFabricClusterConnection],NullReferenceException FullQualifiedErrorId:GetClusterConnectionErrorId、Microsoft.ServiceFabric.Powershell.TestClusterConnection
我可以使用 Visual Studio 成功部署。即使我使用 power shell 从构建计算机运行 Deploy-FabricApplication.ps1,应用程序的部署也不会出现任何错误。但只有当我使用 VSTS 构建步骤(CI 的一部分)运行它时,才会出现上述错误。
请注意,根据 Charisk 在另一个 stackoverflow 线程上的建议,我修改了 Deploy-FabricApplication.ps1 文件,将以下行放在第 169 行之后。 $global:clusterConnection = $clusterConnection
这也没有帮助。预先感谢您的帮助。
最佳答案
在您的发布配置文件中http://s30.postimg.org/bttleqitd/cloud.jpg您使用 StoreLocation="CurrentUser"
但如果您遵循 https://azure.microsoft.com/en-us/documentation/articles/service-fabric-set-up-continuous-integration特别是设置构建机器下的导入您的自动化证书部分,那么您可能已将证书导入到LocalMachine
存储位置。 p>
只需将发布配置文件中的 StoreLocation
从 CurrentUser
更改为 LocalMachine
即可。
关于azure - 无法从 VSTS 连续集成将服务结构应用程序部署到 azure 远程集群,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36519707/