Connect to Quantify API remotely

I am trying to do a proof of concept for connecting a web/ mobile app via a C# integration to the Quantify API and I am having trouble proving that the connection will work. I have downloaded the sample app, and am trying to run that under the same conditions which I will need to use from the app.

I keep getting the following error -
"Avontus.Core.DataPortalException: 'DataPortal.Update failed (System.Data.SqlClient.SqlException (0x80131904): A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. "

  • at the point of calling AvontusPrincipal.Login

Here is my setup:

  • I have a Quantify instance and its associated SQL Server database on a remote server which I am accessing via VPN
  • I have opened both ports 80 and 1433 on the firewall of the Quantify VM
  • I can login to Quantify with a user account on its VM
  • I can access the Quantify database from my PC using SQL Server Server Management Studio and the ASIUser
  • I have Visual Studio running the Quantify.API sample app for C#, it builds ok but errors at runtime

I’m not quite sure what I should be checking for next, or if what I am trying to do is possible. I understand that typically, Quantify must be installed on the client machine, but the app I am going to be developing in is a cloud server, so I will not have the option to install Quantify on the same machine which is why I am trying to verify that I can access the API remotely. Can you please give me some guidance on what I should be looking at to debug this connection next?

Hello Kirsty. This error message indicates a problem with your connection string. I would highly recommend you don’t open up your network this way as hackers are constantly abusing port 1433 and there’s no way to ensure that all of your databases aren’t susceptible to SQL injection attacks. The Quantify database is not vulnerable to this type of attack, in case you’re wondering.

If you use Quantify Web then all of your communication will go through port 80 or port 443 (http or https) and you won’t need to expose any credentials in your connection string as you won’t have one in your app config. Instead, your app config would contain the connection to the website. To see this, you can open the QuantifySettings.xml file in C:\ProgramData\Avontus\Quantify\Settings\

These three settings are automatically set when you login (settings button on login dialog box). Note also that the standard database connection string is encrypted.

image