使用 Azure 自动化连接到 ServiceFabric
Connect to ServiceFabric using Azure Automation
我正在尝试通过 Azure 自动化使用混合 运行book worker 运行 以下测试脚本:
Connect-ServiceFabricCluster -ConnectionEndpoint "the-service-fabric-azure-url" -FindType FindByThumbprint -FindValue "the-thumbprint" -X509Credential -ServerCertThumbprint "the-thumbprint" -StoreLocation CurrentUser -StoreName My -Verbose
$app = Get-ServiceFabricApplication -ApplicationName "fabric:/the-application-name"
Write-Output $app
当我 运行 在我的机器上本地运行这个脚本时,它可以工作。当我 运行 这个脚本在 VM 上使用 Powershell 会话时,它也能正常工作。
当我将此脚本放入 运行book 中,然后通过混合工作组 运行 运行book 时(它指向同一个 VM,因为只有一个工作人员注册到该组),我得到一个错误:
Connect-ServiceFabricCluster : An error occurred during this operation. Please check the trace logs for more details. At line:1 char:1 +
Connect-ServiceFabricCluster -ConnectionEndpoint "my-service-fabric-url... +
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +
CategoryInfo : InvalidOperation: (:) [Connect-ServiceFabricCluster], FabricException +
FullyQualifiedErrorId : CreateClusterConnectionErrorId,Microsoft.ServiceFabric.Powershell.ConnectCluster
我需要配置什么才能使混合组可以执行本地 Powershell 会话已经可以正确执行的相同脚本?
一些额外信息:
- ServiceFabric SDK 已安装在 VM 上。由于我可以通过 Powershell 会话从 VM 连接到 ServiceFabric,因此确认 SDK 在 VM 上可用。
- 混合组工作正常。如果我 运行 一个输出本地机器名称的小型 Powershell 脚本,它 returns 我的 Azure VM 的名称,所以我知道它在机器上 运行 我想让它 运行上。我使用的任何与 ServiceFabric 无关的脚本 运行 都没有问题。
- 我已确保在 VM 上安装 ServiceFabric 证书。在 VM 上,我可以浏览到 SF explorer 网站,我可以通过 powershell 会话 运行 脚本,所以我知道证书安装正确,否则也不会工作。
- 我还将证书安装到 Azure 自动化帐户本身,但这对我遇到的错误没有任何影响。
- 错误提到要检查跟踪日志,但我不知道它在哪里。
- Service Fabric 节点和混合 运行book worker VM 都在同一个虚拟网络上。由于我可以通过 Powershell 会话从 VM 连接到 ServiceFabric,这似乎不是网络问题。
我正在尝试通过 Azure 自动化使用混合 运行book worker 运行 以下测试脚本:
Connect-ServiceFabricCluster -ConnectionEndpoint "the-service-fabric-azure-url" -FindType FindByThumbprint -FindValue "the-thumbprint" -X509Credential -ServerCertThumbprint "the-thumbprint" -StoreLocation CurrentUser -StoreName My -Verbose
$app = Get-ServiceFabricApplication -ApplicationName "fabric:/the-application-name"
Write-Output $app
当我 运行 在我的机器上本地运行这个脚本时,它可以工作。当我 运行 这个脚本在 VM 上使用 Powershell 会话时,它也能正常工作。
当我将此脚本放入 运行book 中,然后通过混合工作组 运行 运行book 时(它指向同一个 VM,因为只有一个工作人员注册到该组),我得到一个错误:
Connect-ServiceFabricCluster : An error occurred during this operation. Please check the trace logs for more details. At line:1 char:1 +
Connect-ServiceFabricCluster -ConnectionEndpoint "my-service-fabric-url... +
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +
CategoryInfo : InvalidOperation: (:) [Connect-ServiceFabricCluster], FabricException +
FullyQualifiedErrorId : CreateClusterConnectionErrorId,Microsoft.ServiceFabric.Powershell.ConnectCluster
我需要配置什么才能使混合组可以执行本地 Powershell 会话已经可以正确执行的相同脚本?
一些额外信息:
- ServiceFabric SDK 已安装在 VM 上。由于我可以通过 Powershell 会话从 VM 连接到 ServiceFabric,因此确认 SDK 在 VM 上可用。
- 混合组工作正常。如果我 运行 一个输出本地机器名称的小型 Powershell 脚本,它 returns 我的 Azure VM 的名称,所以我知道它在机器上 运行 我想让它 运行上。我使用的任何与 ServiceFabric 无关的脚本 运行 都没有问题。
- 我已确保在 VM 上安装 ServiceFabric 证书。在 VM 上,我可以浏览到 SF explorer 网站,我可以通过 powershell 会话 运行 脚本,所以我知道证书安装正确,否则也不会工作。
- 我还将证书安装到 Azure 自动化帐户本身,但这对我遇到的错误没有任何影响。
- 错误提到要检查跟踪日志,但我不知道它在哪里。
- Service Fabric 节点和混合 运行book worker VM 都在同一个虚拟网络上。由于我可以通过 Powershell 会话从 VM 连接到 ServiceFabric,这似乎不是网络问题。