Issue Connecting With An Azure SQL Database from .NET WinForms Application

Tom 1 Reputation point
2024-05-22T16:37:29.1633333+00:00

I'm having an issue connecting to an Azure SQL database from a WinForms application after it has been packaged using InstallShield. The database exists on a virtual network and I'm using a virtual network gateway point-to-site connection. The database is using Entra authentication and the application is using a service principal to connect. I have updated the hosts file to use the correct connection.

The code works when running the application using Visual Studio. I've checked the DLLs installed when the application has been packaged and they are the same. Looking at the database logs, it seems that the service principal is not accessing the database. No errors are being raised but the database queries are not receiving results. This is more difficult to test because the code is working in VS but not after packaging with InstallShield.

How can I fix this?

Windows Forms
Windows Forms
A set of .NET Framework managed libraries for developing graphical user interfaces.
1,869 questions
Azure SQL Database
{count} votes