Skip to content

Invalid SSH Private Key error, when is modified from Environment Variable #8787

@marvill30

Description

@marvill30

Severity

P2 - High (Major functionality broken)

Describe the Bug with repro steps

Expected behavior
The SSH private key stored in the environment variable (Sftp_sshPrivateKey) should be parsed correctly, even when formatted as a multiline key. Updating the key directly in the environment variable should allow the connection to authenticate successfully without requiring the creation of a new connection.

Actual behavior
When updating the SSH private key in the environment variable, Logic Apps fails to parse the key and returns the error:
"Failed to parse the provided private key: 'Invalid private key file.'"
The run fails with ServiceProviderActionFailed and InvalidServiceProviderConnection.
However, creating a new connection with the same key works correctly. The issue appears related to the multiline formatting of the key in environment variables.

error
{
'code': 'ServiceProviderActionFailed',
'message': 'The service provider action failed with error code 'InvalidServiceProviderConnection' and error message 'Failed to parse the provided private key: 'Invalid private key file.'.'.'
}

What type of Logic App Is this happening in?

Standard (Portal)

Are you experiencing a regression?

No response

Which operating system are you using?

Windows

Did you refer to the TSG before filing this issue? https://aka.ms/lauxtsg

Yes

Workflow JSON

no workflow json available

Screenshots or Videos

No response

Environment

Azure portal.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions