无法从 VSTS 持续集成将服务结构应用程序部署到 Azure 远程集群
Unabled to deploy service fabric application to azure remote cluster from VSTS continuous inrgration
我已根据此文档在 Visual Studio Team Services 中为 Service Fabric 应用程序配置 CI 构建:https://azure.microsoft.com/en-us/documentation/articles/service-fabric-set-up-continuous-integration。
但是我已经更改了上面文档中指定的部署部分。因为我想部署在我之前创建的远程 azure 集群上,所以我调用
Deploy-FabricApplication.ps1 以及使用电源 shell 所需的参数。但不幸的是,这是行不通的。我收到以下错误:
[void](Connect-ServiceFabricCluster @ClusterConnectionParameters)
InvalidOperation: (:) [Connect-ServiceFabricCluster], FabricException
FullyQualifiedErrorId : CreateClusterConnectionErrorId,Microsoft.ServiceFabric.Powershell.ConnectCluster
警告:无法验证与 Service Fabric 群集的连接。
[错误]Test-ServiceFabricClusterConnection:集群连接实例为空
[错误]在 C:\Program Files\Microsoft SDKs\Service
[错误]Fabric\Tools\PSModule\ServiceFabricSDK\Publish-NewServiceFabricApplication.ps1:119 char:16
空白
: ResourceUnavailable: (:) [Test-ServiceFabricClusterConnection], NullReferenceException
FullyQualifiedErrorId : GetClusterConnectionErrorId,Microsoft.ServiceFabric.Powershell.TestClusterConnection
我可以使用 visual studio 成功部署。即使我 运行 Deploy-FabricApplication.ps1 使用 power shell 从构建机器中部署应用程序也没有任何错误。但只有当我 运行 它使用 VSTS 构建步骤(CI 的一部分)时,才会出现上述错误。
请注意,根据 Charisk 在另一个 Whosebug 线程上的建议,我修改了 Deploy-FabricApplication.ps1 文件以将以下行放在第 169 行之后。
$global:clusterConnection = $clusterConnection
这也无济于事。在此先感谢您的帮助。
点源表示法表示使用 . "xxx.ps1"。详情参考这个link:PowerShell – What is dot sourcing and why use it?
在您的发布配置文件 http://s30.postimg.org/bttleqitd/cloud.jpg you use StoreLocation="CurrentUser"
but if you followed https://azure.microsoft.com/en-us/documentation/articles/service-fabric-set-up-continuous-integration 中,特别是 导入您的自动化证书 部分 设置您的构建机器 然后您可能已将您的证书导入 LocalMachine
存储位置。
只需将发布配置文件中的 StoreLocation
从 CurrentUser
更改为 LocalMachine
即可。
我已根据此文档在 Visual Studio Team Services 中为 Service Fabric 应用程序配置 CI 构建:https://azure.microsoft.com/en-us/documentation/articles/service-fabric-set-up-continuous-integration。
但是我已经更改了上面文档中指定的部署部分。因为我想部署在我之前创建的远程 azure 集群上,所以我调用 Deploy-FabricApplication.ps1 以及使用电源 shell 所需的参数。但不幸的是,这是行不通的。我收到以下错误:
[void](Connect-ServiceFabricCluster @ClusterConnectionParameters) InvalidOperation: (:) [Connect-ServiceFabricCluster], FabricException FullyQualifiedErrorId : CreateClusterConnectionErrorId,Microsoft.ServiceFabric.Powershell.ConnectCluster
警告:无法验证与 Service Fabric 群集的连接。
[错误]Test-ServiceFabricClusterConnection:集群连接实例为空 [错误]在 C:\Program Files\Microsoft SDKs\Service [错误]Fabric\Tools\PSModule\ServiceFabricSDK\Publish-NewServiceFabricApplication.ps1:119 char:16 空白 : ResourceUnavailable: (:) [Test-ServiceFabricClusterConnection], NullReferenceException FullyQualifiedErrorId : GetClusterConnectionErrorId,Microsoft.ServiceFabric.Powershell.TestClusterConnection
我可以使用 visual studio 成功部署。即使我 运行 Deploy-FabricApplication.ps1 使用 power shell 从构建机器中部署应用程序也没有任何错误。但只有当我 运行 它使用 VSTS 构建步骤(CI 的一部分)时,才会出现上述错误。
请注意,根据 Charisk 在另一个 Whosebug 线程上的建议,我修改了 Deploy-FabricApplication.ps1 文件以将以下行放在第 169 行之后。 $global:clusterConnection = $clusterConnection
这也无济于事。在此先感谢您的帮助。
点源表示法表示使用 . "xxx.ps1"。详情参考这个link:PowerShell – What is dot sourcing and why use it?
在您的发布配置文件 http://s30.postimg.org/bttleqitd/cloud.jpg you use StoreLocation="CurrentUser"
but if you followed https://azure.microsoft.com/en-us/documentation/articles/service-fabric-set-up-continuous-integration 中,特别是 导入您的自动化证书 部分 设置您的构建机器 然后您可能已将您的证书导入 LocalMachine
存储位置。
只需将发布配置文件中的 StoreLocation
从 CurrentUser
更改为 LocalMachine
即可。