Deploy Service Fabric from powershell. Error -> Get-ServiceFabricClusterManifest : Cluster connection instance is null

前端 未结 1 1739
有刺的猬
有刺的猬 2021-01-11 15:59

I am trying to publish Service Fabric application to Azure with powershell. I want to connect to the cluster and then call script \"Deploy-FabricApplication.ps1\"(one that i

1条回答
  •  离开以前
    2021-01-11 16:34

    When calling Connect-ServiceFabricCluster a local $clusterConnection variable is set. Some of the SDK scripts then expect that variable to be set, but because you're executing your script in different scope, that local variable isn't available to them.

    You can either dot source the call to Deploy-FabricApplication.ps1

    . .\Deploy-FabricApplication.ps1 -PublishProfileFile $PublishProfileFile -ApplicationPackagePath $ApplicationPackagePath -OverrideUpgradeBehavior $OverrideUpgradeBehavior -OverwriteBehavior $OverwriteBehavior -DeployOnly:$DeployOnly -UnregisterUnusedApplicationVersionsAfterUpgrade:$UnregisterUnusedApplicationVersionsAfterUpgrade -UseExistingClusterConnection:$true -SkipPackageValidation:$SkipPackageValidation
    

    or create a $global:clusterConnection variable that contains the local $clusterConnection variable

    $global:clusterConnection = $clusterConnection
    

    0 讨论(0)
提交回复
热议问题