Search code examples
azuresftpazure-logic-appsazure-keyvaultssh-keys

Can I pass an Azure Key Vault Secret to an SFTP connector in an Azure Logic App?


Maybe I'm going about this the wrong way, but I uploaded an SSH key to my Key Vault and am trying to pass this to an SFTP-SSH connection in my logic app.

Secret flow

However, when I try to put the secret value into the SSH private key field of the connection, it doesn't bring up the Dynamic variables form. I'm guessing this might be because the API Connection is a separate object outside the Logic App?

Is there a way for me to pass the ssh key from the key vault to the SFTP connection? Whether it's in the logic app or not. I want to be able to deploy this solution without re-entering the key manually into the API.

I actually found this video where the guy looked like he's going to do exactly this type of flow, but it looks like part 1 of the video and there's no part 2 where the actual execution of this happens: https://www.youtube.com/watch?v=5W8g0KER8RM


Solution

  • You cannot do this from the portal.

    The youtube video you refer to is to allow ease of deployment using arm templates. Sadly the 2nd part of the video is not available.

    If you are using the portal, you need to setup the connection the first time. This is also secure as no one can see the credentials once the connection is made. But this is not ok when you have to redeploy the logic app to multiple environments in which case you need to manually setup the connection credentials each time. To make this task easy, you setup the SSH keys as shown in the video, and then configure an arm template to use the secrets from the key vault.

    You can check the Microsoft forum answer to the same question HERE.