我正试图通过 Azure Automation 使用混合 runbook 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
当我在我的机器上本地运行这个脚本时,它可以工作。当我在虚拟机上使用Powershell会话运行此脚本时,它也能正常运行。
当我将此脚本放入运行簿中,然后通过混合工作组(该工作组指向同一虚拟机,因为只有一个工人注册到该组)运行运行簿时,我得到一个错误。
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会话已经可以正确执行的相同脚本?
一些额外的信息。