Dynamic SFTP send port Error RRS feed

  • Question

  • Hi All,

    I am getting below runtime error when trying to send message dynamically to SFTP address.

    Assignment code:

    ContrlMsgOut = ContrlMsg;
    ContrlMsgOut(*) = ContrlMsg(*);
    ContrlMsgOut(SFTP.UserName) = "something";
    ContrlMsgOut(SFTP.Password) = "something";
    ContrlMsgOut(SFTP.AccessAnyServerHostKey) = true;
    ContrlMsgOut(SFTP.TargetFileName) = "%MessageID%.txt";

    dynamic send port code:

    sndDynamicSFTPSenderPort(Microsoft.XLANGs.BaseTypes.Address) = sAddressString;
    sndDynamicSFTPSenderPort(Microsoft.XLANGs.BaseTypes.TransportType) ="SFTP";

    -- Confusion--

    Similar logic of code works in other application, infact I copied the same code. Is it the SFTP adapter issue?


    Error details: Microsoft.BizTalk.Adapter.SftpInvoker.SftpException: Create SFTP facade error.

    Server stack trace: 
       at Microsoft.BizTalk.Adapter.SftpInvoker.SftpInvoker..ctor(String host, Int32 port, String username, String password, String key, String privateKeyPassword, Boolean acceptAnyserverKey, String expectedServerFingerPrint, String proxyhost, Int32 proxyport, String proxyuserName, String proxypassword, Int32 proxytype, Int32 encryptionType, Boolean isKeyData)
       at Microsoft.BizTalk.Adapter.Sftp.SftpConnection.OpenUnderlyingConnection(SftpConnectionProperties connectionProperties)
       at Microsoft.BizTalk.Adapters.CommonHelpers.Connection`3.ConnectionPool`3.GetConnection(T1 connectionProperties, TimeSpan timeout)
       at Microsoft.BizTalk.Adapters.CommonHelpers.Connection`3.GetConnection(T connectionProperties, TimeSpan timeout)
       at Microsoft.BizTalk.Adapter.Sftp.SftpOutputChannel.Send(Message message, TimeSpan timeOut)
       at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]& outArgs)
       at System.Runtime.Remoting.Messaging.StackBuilderSink.AsyncProcessMessage(IMessage msg, IMessageSink replySink)

    Exception rethrown at [0]: 
       at System.Runtime.AsyncResult.End[TAsyncResult](IAsyncResult result)
       at System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.End(SendAsyncResult result)
       at System.ServiceModel.Channels.ServiceChannel.EndCall(String action, Object[] outs, IAsyncResult result)

    Exception rethrown at [1]: 
       at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
       at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
       at System.ServiceModel.Channels.IOutputChannel.EndSend(IAsyncResult result)
       at Microsoft.BizTalk.Adapter.Wcf.Runtime.WcfClient`2.SendCallback(IAsyncResult result) 

    Thursday, June 23, 2016 8:04 AM

All replies

  • Hi Prabhdeep

    Can you check if you can connect to the same SFTP destination using a static SFTP SendPort and transmit a file?

    Thanks Arindam

    Thursday, June 23, 2016 10:15 AM
  • Hi Prabhdeep,

    What is your sAddressString ??

    Is it in format SFTP:// ?? or SFTP:// ??


    Blog: My Blog

    BizTalkApplicationDeploymentTool: BizTalk Application Deployment Tool

    LinkedIn: LinkedIn

    Thursday, June 23, 2016 5:13 PM
  • Hi Prabhdeep,

    You most likely have a misconfiguration regarding the connection parameters to the SFTP site. Have you verified that you can connect to the site using static SFTP SendPort or by using another client such as FileZilla.

    Rachit Sikroria (Microsoft Azure MVP)

    Thursday, June 23, 2016 6:16 PM
  • Hi All,

    Yes,  I am able to connect to sftp using winscp and upload files using same account. 


    My address format is (notice no port number and star in the end)


    - I tried putting following in the end as well:

    1. *.*

    2. *.txt

    3. %MessageID%.txt

    Thursday, June 23, 2016 6:24 PM
  • Are you also able to transfer a file using static SFTP SendPort to the same SFTP destination?

    Thanks Arindam

    Thursday, June 23, 2016 6:36 PM
  • Arindam - Yes

    When I make it direct bound port and enter all directory info etc in physical port. It works.

    BUt, thing is physical port has some extra fields which dynamic doesn't show in Orchestartion assignment shape

    Thursday, June 23, 2016 8:20 PM