Assume that you use Dynamic SFTP port. When you upgrade Microsoft BizTalk Server from 2013 or 2013 R2 to 2016, if the SFTP address that's used at runtime does not specify a port number, the Dynamic SFTP port stops working with the following error:

System.ArgumentException: Port number cannot be negative


Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.


This problem is fixed in the following cumulative update for BizTalk Server:

Note The port number '22' is automatically used when there is no port number specified in the SFTP server address that's used at runtime.


In BizTalk Server 2013 or 2013 R2, when the port number is not specified, the default SFTP port number '22' is used by default. In BizTalk Server 2016, the value '-1' is used by default. This causes the error and requires the Dynamic send port addresses to include the default port number explicitly. For example:

SFTPDynSendMsg(Microsoft.XLANGs.BaseTypes.Address)= "sftp://" + "%MessageID%.xml";
instead of without port number:
SFTPDynSendMsg(Microsoft.XLANGs.BaseTypes.Address)= "sftp://" + "%MessageID%.xml";


For information about the service packs and cumulative update list for BizTalk Server, see the following article in the Microsoft Knowledge Base:

2555976 Service pack and cumulative update list for BizTalk Server

For more information about BizTalk Server hotfixes, see the following article in the Microsoft Knowledge Base:

2003907 Information about BizTalk hotfixes and Cumulative Update support

Need more help?

Expand your skills
Explore Training
Get new features first
Join Microsoft Insiders

Was this information helpful?

What affected your experience?

Thank you for your feedback!