Run a Service Fabric SDK PowerShell Script

Octopus.AzureServiceFabricPowerShell exported 2026-07-22 by Octopus Deploy belongs to ‘Azure’ category.

Run a PowerShell script using a Service Fabric cluster context.

Parameters

When this step is included in a project’s deployment process, the parameters below can be set.

Connection Endpoint

Octopus.Action.ServiceFabric.ConnectionEndpoint

The connection endpoint of the Service Fabric cluster. Used in legacy mode only.

Example: tcp://mycluster.eastus.cloudapp.azure.com:19000

Security Mode

Octopus.Action.ServiceFabric.SecurityMode

The security mode used to connect to the Service Fabric cluster. Used in legacy mode only.

Allowed values: Unsecure, SecureClientCertificate, SecureAzureAD

Default: Unsecure

Server Certificate Thumbprint

Octopus.Action.ServiceFabric.ServerCertThumbprint

The server certificate thumbprint used to communicate with the secure cluster.

Client Certificate

Octopus.Action.ServiceFabric.ClientCertVariable

The client certificate variable used to communicate with the secure cluster when using client certificate security mode.

AAD Credential Type

Octopus.Action.ServiceFabric.AadCredentialType

The Azure Active Directory credential type when using AAD security mode.

Allowed values: UserCredential, ClientCredential

Default: UserCredential

Client Application Secret

Octopus.Action.ServiceFabric.AadClientCredentialSecret

The client application secret used to communicate with the secure cluster via AAD client credentials.

AAD Username

Octopus.Action.ServiceFabric.AadUserCredentialUsername

The Azure AD user’s username used to communicate with the secure cluster.

AAD Password

Octopus.Action.ServiceFabric.AadUserCredentialPassword

The Azure AD user’s password used to communicate with the secure cluster.

Script Source

Octopus.Action.Script.ScriptSource (required)

The source of the script to run.

Allowed values: Inline, Package, GitRepository

Default: Inline

Script Syntax

Octopus.Action.Script.Syntax

The scripting language to use. Only PowerShell is supported for Service Fabric scripts.

Allowed values: PowerShell

Default: PowerShell

Script Body

Octopus.Action.Script.ScriptBody

The inline script body to execute when script source is Inline.

Script File Name

Octopus.Action.Script.ScriptFileName

The path to the script file inside the package or Git repository.

Example: Deploy.ps1

Script Parameters

Octopus.Action.Script.ScriptParameters

Parameters to pass to the script.

Example: -Environment #{Octopus.Environment.Name}

Enable Legacy Mode

Octopus.Action.ServiceFabric.IsLegacyMode

Select legacy mode if you wish to configure connection-related properties on the step and not through Azure Targets.

Allowed values: True, False

Default: False

Optional features

Enable features by adding their IDs to Octopus.Action.EnabledFeatures (a comma-separated list).

Substitute Variables in Templates Octopus.Features.SubstituteInFiles

Transforms files using the Octopus #{Variable} substitution syntax. Enabled by default for package deployments.

Octopus.Action.SubstituteInFiles.TargetFiles

Octopus.Action.SubstituteInFiles.TargetFiles

Newline-separated list of file names to transform (relative to package). Wildcards supported.

Octopus.Action.SubstituteInFiles.OutputEncoding

Octopus.Action.SubstituteInFiles.OutputEncoding

Encoding name for the output file (e.g. utf-8). Optional.

Structured Configuration Variables Octopus.Features.JsonConfigurationVariables

Replace settings in JSON, YAML, XML, and Java Properties files with Octopus variables. Enabled by default for package deployments.

Octopus.Action.Package.JsonConfigurationVariablesTargets

Octopus.Action.Package.JsonConfigurationVariablesTargets

Newline-separated list of target files (e.g. appsettings.json). Wildcards supported.

.NET Configuration Transforms Octopus.Features.ConfigurationTransforms

Runs configuration file transforms. Enabled by default for package deployments.

Octopus.Action.Package.AutomaticallyRunConfigurationTransformationFiles

Octopus.Action.Package.AutomaticallyRunConfigurationTransformationFiles

Run default XML transforms (True/False).

Octopus.Action.Package.AdditionalXmlConfigurationTransforms

Octopus.Action.Package.AdditionalXmlConfigurationTransforms

Comma- or newline-separated list of additional transform rules (e.g. Web.Release.config => Web.config).

.NET Configuration Variables Octopus.Features.ConfigurationVariables

Replace appSettings and connectionStrings in .config files. Enabled by default for package deployments.

Octopus.Action.Package.AutomaticallyUpdateAppSettingsAndConnectionStrings

Octopus.Action.Package.AutomaticallyUpdateAppSettingsAndConnectionStrings

Replace appSettings and connectionStrings in .config files (True/False).

PowerShell Edition Octopus.Features.SelectPowerShellEditionForWindows

Specify the edition of PowerShell used during deployments on Windows.

Octopus.Action.PowerShell.Edition

Octopus.Action.PowerShell.Edition

PowerShell edition on Windows (Desktop or Core).

Allowed values: Desktop, Core

Step configuration using OCL

Example in Octopus Configuration Language (OCL):

step "service-fabric-powershell" {
    name = "Service Fabric PowerShell"
    properties = {
        Octopus.Action.TargetRoles = "service-fabric-cluster"
    }

    action {
        action_type = "Octopus.AzureServiceFabricPowerShell"
        properties = {
            Octopus.Action.RunOnServer = "false"
            Octopus.Action.Script.ScriptBody = "Get-ServiceFabricApplication"
            Octopus.Action.Script.ScriptSource = "Inline"
            Octopus.Action.Script.Syntax = "PowerShell"
            OctopusUseBundledTooling = "False"
        }
    }
}

Page updated on Wednesday, July 22, 2026