Skip to content

Fix StepTemplate "SSIS deploy ispac from package parameter". Prefer avail SSIS assemblies; Fall back to pinned SqlServer module#1658

Open
bcullman wants to merge 2 commits intoOctopusDeploy:masterfrom
bcullman:fix-ssis-deploy-from-ispac-use-valid-psmodule
Open

Fix StepTemplate "SSIS deploy ispac from package parameter". Prefer avail SSIS assemblies; Fall back to pinned SqlServer module#1658
bcullman wants to merge 2 commits intoOctopusDeploy:masterfrom
bcullman:fix-ssis-deploy-from-ispac-use-valid-psmodule

Conversation

@bcullman
Copy link
Contributor

@bcullman bcullman commented Mar 5, 2026

Problem

The current template assumes the installed SqlServer PowerShell module contains the SSIS assemblies and attempts to load all DLLs from that module folder. On systems with newer SqlServer module versions, that assumption no longer holds, and the template can fail during assembly loading with errors like:

The module was expected to contain an assembly manifest. (Exception from HRESULT: 0x80131018)

Solution

The runtime selection logic has been updated to use a clearer, more targeted decision path:

  1. First, check whether the SSIS IntegrationServices type is already available in the current PowerShell session.
  2. If not already loaded, try to resolve it from the machine, including the GAC path used by SSIS assemblies on hosts where those assemblies are already installed.
  3. If SSIS is already available, use the installed SqlServer module only for cmdlets such as Invoke-Sqlcmd.
  4. If SSIS is not available, fall back to a temporary pinned SqlServer module (21.1.18256), import it, and load the managed assemblies required for SSIS deployment.

This preserves the existing feature set, including environment synchronization, while avoiding unnecessary temporary module downloads on hosts where the required SSIS assemblies are already present.

Additional behavior changes

  • Assembly loading from the pinned module is now safer:
    • managed assemblies are loaded explicitly
    • native / incompatible DLLs are skipped instead of causing the template to fail
  • Temporary pinned module cleanup now only runs when the pinned module was actually used
  • The bottom-of-file script body was encapsulated into functions to make the execution flow clearer:
    • one function initializes the SSIS / module runtime
    • one function acts as the main entry point for deployment
  • Env Var value reporting was cleaned up to make the reporting easier to scan by eye
  • Small cleanup changes were also made for maintainability:
    • whitespace cleanup
    • spelling fixes where non-breaking
    • removed region markers that are no longer needed now that all executable logic is function-scoped

Why this approach

This keeps the template compatible with environments that already have SSIS assemblies available, while still preserving the pinned-module fallback for environments that do not.

It also narrows the fallback path so the pinned module is only used when it is actually required, instead of downloading and importing it unconditionally.

Scope

This change is intended to be a runtime-loading fix and structural cleanup. The deployment behavior and existing template features are otherwise preserved.

Pre-requisites

[✔] Id should be a GUID that is not 00000000-0000-0000-0000-000000000000
NOTE If you are modifying an existing step template, please make sure that you do not modify the Id property (updating the Id will break the Library sync functionality in Octopus).
[✔] Version should be incremented, otherwise the integration with Octopus won't update the step template correctly
[✔] Parameter names should not start with $
[✔] Step template parameter names (the ones declared in the JSON, not the script body) should be prefixed with a namespace so that they are less likely to clash with other user-defined variables in Octopus (see OctopusDeploy/Issues#2126). For example, use an abbreviated name of the step template or the category of the step template).
[✔] LastModifiedBy field must be present, and (optionally) updated with the correct author
[✔] The best practices documented here have been applied
[NA] If a new Category has been created:
[NA] An image with the name {categoryname}.png must be present under the step-templates/logos folder
[NA] The switch in the humanize function in gulpfile.babel.js must have a case statement corresponding to it

Fixes #1657

@github-actions
Copy link

github-actions bot commented Mar 5, 2026

Start Hyponome locally

docker pull ghcr.io/hnrkndrssn/hyponome:main
docker run --rm -p 8000:8080 -it ghcr.io/hnrkndrssn/hyponome:main

Review in Hyponome

@bcullman bcullman changed the title use compat version of SqlServer PSModule use compat version of SqlServer PSModule for SSIS deploy ispac from package Mar 5, 2026
@bcullman bcullman marked this pull request as draft March 5, 2026 16:55
@bcullman bcullman marked this pull request as ready for review March 6, 2026 21:50
@bcullman bcullman changed the title use compat version of SqlServer PSModule for SSIS deploy ispac from package fix StepTemplate Deploy ISPAC SSIS project from a package. prefer avail; SSIS assemblies; fall back to pinned SqlServer module Mar 6, 2026
@bcullman bcullman changed the title fix StepTemplate Deploy ISPAC SSIS project from a package. prefer avail; SSIS assemblies; fall back to pinned SqlServer module fix StepTemplate Deploy ISPAC SSIS project from a package. prefer avail SSIS assemblies; fall back to pinned SqlServer module Mar 6, 2026
@bcullman bcullman changed the title fix StepTemplate Deploy ISPAC SSIS project from a package. prefer avail SSIS assemblies; fall back to pinned SqlServer module fix StepTemplate Deploy ISPAC SSIS project from a package. Prefer avail SSIS assemblies; Fall back to pinned SqlServer module Mar 6, 2026
@bcullman bcullman changed the title fix StepTemplate Deploy ISPAC SSIS project from a package. Prefer avail SSIS assemblies; Fall back to pinned SqlServer module Fix StepTemplate "SSIS deploy ispac from package parameter". Prefer avail SSIS assemblies; Fall back to pinned SqlServer module Mar 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SSIS deploy ispac from package fails when incompatable sqlserver powershell module is used

1 participant