0

We are having problems using an SFTP connection in Logic App with an SSH private key, when the key is stored as an app setting. The connection needs the key to be in multiline format, which it is, but it doesn't work. If the key is stored directly in connections.json, it works fine.

The reason we want to store it as an app setting is because app settings allows for key vault references.

Our app settings: enter image description here

Our connections.json: enter image description here

The error message we get: enter image description here

Viggo Lundén
  • 748
  • 1
  • 6
  • 31

1 Answers1

0

We managed to solve it.

To enter strings in app settings that contain escape characters, we need to use https://resources.azure.com/.

We still had the problem fetching key vault secrets from Key Vault, because the strings entered in the portal most likely also don't support escape characters.

So we had to do the following:

$RawSecret =  Get-Content ".\key" -Raw
$SecureSecret = ConvertTo-SecureString -String $RawSecret -AsPlainText -Force

and then

Set-AzKeyVaultSecret -VaultName "key-vault-name" -Name "private-key" -SecretValue $SecureSecret

Now the the private key is stored in key vault, and the app setting has a key vault secret reference to that secret.

Viggo Lundén
  • 748
  • 1
  • 6
  • 31