Config / Data Exchange / File Exchange Service

File Exchange Service

The Anvaigo EDI Connect file exchange service allows data to be received and sent by other systems. For this purpose, a service outside Dynamics is addressed, which processes the data. This service is usually run on the ServiceTier (OnPrem) installations or on a publicly accessible server (Cloud installations). For operation with Anvaigo EDI Connect on your own infrastructure, we offer free licenses for the service.

To use this service you need Anvaigo EDI Connect version 5.3.0.4 or above.

The service can be used from all installations of our module (OnPrem and Cloud) starting with Dynamics NAV 2013.

Overview

The Anvaigo File Exchange Service is provided as a ZIP archive containing all necessary components to run the application, including the required .NET runtime. Due to its dependencies, the application is only supported on Windows 64-bit systems.

The service can be launched as a console application, which is useful for testing and debugging. For production use, it is recommended to register the application as a Windows service.

The service can be hosted on any system that is accessible from Dynamics. However, for installations where the Dynamics ServiceTier is available, it is strongly recommended to install the service on the same machine as the ServiceTier.

Note that the service does not support running multiple instances in parallel. If you have multiple ServiceTiers on different machines, the service should only be installed and operated on a single machine.

If the service is hosted on a different machine than the ServiceTier, you must configure access accordingly. In such cases, it is strongly advised to use an encrypted Https connection, which can be configured through the service settings.

The following protocols are supported by the File Exchange Service: POP3 and SMTP (OAuth2 is supported for both), FTP, FTPS and SFTP. Additionally the local (network) file system of the server can be accessed.

Installation the Service

Extract the ZIP Archive
Before unpacking the ZIP file, ensure Windows recognizes it as a trusted source. This step is crucial, as the archive contains multiple DLL files that must be trusted by the operating system after extraction.

Copy Files to Server Directory
Extract and copy all contents of the ZIP file, including AnvaigoFileExchangeService.exe, appsettings.json, and all other included files, into a target directory on your server.

Assign Directory Permissions
Grant the appropriate access rights to the user account that will run the service. This user must have full access to the target directory to ensure the service operates correctly.

The application can be installed as a windows service with the following command (in the console or Powershell) with administrator privileges:

sc.exe create "Anvaigo File Exchange Service" binpath="C:\Installation\Path\AnvaigoFileExchangeService.exe --contentRoot=C:\Installation\Path"
Install Service

Please change C:\Installation\Path\ to the path that you have copied the application to.

For testing and debugging purposes, the AnvaigoFileExchangeService.exe can be started directly. In this standalone mode, the application runs as long as the console window remains open and will output log events directly to the console, which is useful for troubleshooting. Note that the application cannot be run in standalone mode while the service is active. You must stop the Windows service before starting the application manually.

Configuration

Most of the configuration is done in Microsoft Dynamics 365 Business Central. There are a few settings that have to be configured for the service. You can find these settings in the appsettings.json file that is supplied with the service. The configuration file has to be in the same folder as the application file.

ApiKey

Change this value to a long secret string and enter the same string in Dynamics. We recommend to create a GUID and remove all special characters, but it is up to you to choose a secure string. In case Http is used the secret is transferred in plain text. Please use Https when the service is not installed on the ServiceTier.

DefaultAddTimestampToArchiveFilename

If the communication channel in Dynamics is set to archive the file, with this option activated a timestamp will be added to the filename in the archive. The default value is false.

AllowLocalFilesystemAccess

Whether the service can access all local files on the server (using the user account that runs the service) and execute script files. The default value is false.

Please make sure that the user running the service can only access the directories that should be accessible to the FES. Setting this option to true means that anyone who has access to the Dynamics communication channels or the API key can read and write files in all directories accessible to the FES service.

The potential security implications are the reason this option is disabled by default.

DeactivateScriptExecution

If you want to run scripts to retrieve or send files from the filesystem, set this option to false. The default value is true.

SshDefaultLibrary

The default SFTP library used by the Anvaigo File Exchange Service is “Ssh.NET”. If the server requires authentication methods not supported by Ssh.NET, such as rsa-sha2-256, you can switch to using “WinSCP” by changing the configuration setting accordingly.

In such cases, we strongly recommend testing the connection using the WinSCP GUI, which can be downloaded from https://winscp.net/eng/download.php. This helps verify that the connection can be established successfully before configuring it in the service.

When using key-based authentication, a .ppk key file is required. You can create this file using the “PuTTYgen” tool.

FtpDefaultSlowListing

Enable slow listing mode if default directory listings fail. This retrieves information for each file individually and is significantly slower. The default value is false.

FtpDefaultUseGnuTls

Use GnuTLS instead of the Windows TLS library for FTPS. GnuTLS supports different encryption options and is necessary if the partner requires more secure elliptic curves. This setting applies globally to all connections. The default value is false.

DeactivateWelcomePage

If you paste the connection url into a browser, you’ll see a welcome page from the File Exchange service. If you won’t want that behaviour, set it to . The default value is false.

EnableHstsHeader

If you want to enable HSTS (HTTP Strict Transport Security) header, set this option to . The default value is false.

AllowedHosts

Limit the access to the service to certain IPs or DNS names. (Learn more here)

Kestrel

The configuration of the service endpoint, like the address, port and whether to use Https or Http. (Learn more here)

Next Steps

You can now setup the communication channel in Anvaigo EDI Connect.

FAQ