Service Fabric PowerShell task

Azure Pipelines

Use this task in a build or release pipeline to run a PowerShell script within the context of an Azure Service Fabric cluster connection. Runs any PowerShell command or script in a PowerShell session that has a Service Fabric cluster connection initialized.


Service Fabric

  • This task uses a Service Fabric installation to connect and deploy to a Service Fabric cluster.

  • Azure Service Fabric Core SDK on the build agent.

YAML snippet

# Service Fabric PowerShell
# Run a PowerShell script in the context of an Azure Service Fabric cluster connection
- task: ServiceFabricPowerShell@1
    #scriptType: 'FilePath' # Options: filePath, inlineScript
    #scriptPath: # Optional
    #inline: '# You can write your PowerShell scripts inline here. # You can also pass predefined and custom variables to this script using arguments' # Optional
    #scriptArguments: # Optional


Argument Description
Cluster Connection The Azure Service Fabric service connection to use to connect and authenticate to the cluster.
Script Type Specify whether the script is provided as a file or inline in the task.
Script Path Path to the PowerShell script to run. Can include wildcards and variables. Example: $(system.defaultworkingdirectory)/**/drop/projectartifacts/**/docker-compose.yml. Note: combining compose files is not supported as part of this task.
Script Arguments Additional parameters to pass to the PowerShell script. Can be either ordinal or named parameters.
Inline Script The PowerShell commands to run on the build agent. More information
Control options See Control options

Also see: Service Fabric Compose Deploy task

Open source

This task is open source on GitHub. Feedback and contributions are welcome.

Q & A

Do I need an agent?

You need at least one agent to run your build or release. Get an agent for Linux, macOS, or Windows.

I'm having problems. How can I troubleshoot them?

See Troubleshoot Build and Release.

I can't select a default agent pool and I can't queue my build or release. How do I fix this?

See Agent pools.