Certificate Issue While Connecting Azure Virtual Machine Database

If you are trying to connect to a SQL Server database which resides in Azure Windows Virtual Machine from SQL Server Management Studio and a .NET application .

We will explain those issues and share our experience on how you can solve these issues.

Issue 1 : When you tried to connect to Azure VM SQL Server from SQL Server Management Studio and If you get the following error and couldn’t connect to the database.

Solution :

Issue 2- You were not able to connect to the Database from the Application even though you provided proper server details and parameters in the connection string.

Error :

Solution :

When you trying to connect to the Azure VM Database, you need to add the following part in the connection string.

Check whether or not there is a TrustServerCertificate available in your Webconfig. If not, then add this and make it True. If it is available and the value is False, then make it True.

The WebConfig file connection string should be as shown below:

intforce software is software service company and providing complete IT solution with fresh perspective. https://intforcesoftware.com/