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
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